Marble

CelestialSortFilterProxyModel.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2004-2007 Torsten Rahn <tackat@kde.org>
4// SPDX-FileCopyrightText: 2007 Inge Wallin <ingwa@kde.org>
5// SPDX-FileCopyrightText: 2007 Thomas Zander <zander@kde.org>
6// SPDX-FileCopyrightText: 2010 Bastian Holst <bastianholst@gmx.de>
7// SPDX-FileCopyrightText: 2011-2013 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
8// SPDX-FileCopyrightText: 2012 Illya Kovalevskyy <illya.kovalevskyy@gmail.com>
9//
10
11#include <QSortFilterProxyModel>
12
13#ifndef MARBLE_CELESTIALSORTFILTERPROXYMODEL_H
14#define MARBLE_CELESTIALSORTFILTERPROXYMODEL_H
15
16namespace Marble {
17
18/**
19 * @brief The CelestialSortFilterProxyModel class is a proxy used by both
20 * MapViewWidget's listview, and MapChangeEditDialog's listview.
21 */
23{
25
26public:
29 /**
30 * @brief A small trick to change names for dwarfs and moons
31 */
32 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
33
34private:
35 void setupPriorities();
36 void setupMoonsList();
37 void setupDwarfsList();
38
39protected:
40 bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
41
42private:
43 QMap<QString, int> m_priority;
44 QList<QString> m_moons;
45 QList<QString> m_dwarfs;
46};
47}
48
49#endif
The CelestialSortFilterProxyModel class is a proxy used by both MapViewWidget's listview,...
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
A small trick to change names for dwarfs and moons.
Binds a QML item to a specific geodetic location in screen coordinates.
Q_OBJECTQ_OBJECT
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
DisplayRole
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.