Marble

CelestialSortFilterProxyModel.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2004-2007 Torsten Rahn <[email protected]>
4 // SPDX-FileCopyrightText: 2007 Inge Wallin <[email protected]>
5 // SPDX-FileCopyrightText: 2007 Thomas Zander <[email protected]>
6 // SPDX-FileCopyrightText: 2010 Bastian Holst <[email protected]>
7 // SPDX-FileCopyrightText: 2011-2013 Bernhard Beschow <[email protected]>
8 // SPDX-FileCopyrightText: 2012 Illya Kovalevskyy <[email protected]>
9 //
10 
11 #include <QSortFilterProxyModel>
12 
13 #ifndef MARBLE_CELESTIALSORTFILTERPROXYMODEL_H
14 #define MARBLE_CELESTIALSORTFILTERPROXYMODEL_H
15 
16 namespace Marble {
17 
18 /**
19  * @brief The CelestialSortFilterProxyModel class is a proxy used by both
20  * MapViewWidget's listview, and MapChangeEditDialog's listview.
21  */
23 {
24  Q_OBJECT
25 
26 public:
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 
34 private:
35  void setupPriorities();
36  void setupMoonsList();
37  void setupDwarfsList();
38 
39 protected:
40  bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
41 
42 private:
43  QMap<QString, int> m_priority;
44  QList<QString> m_moons;
45  QList<QString> m_dwarfs;
46 };
47 }
48 
49 #endif
Q_OBJECTQ_OBJECT
DisplayRole
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.
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const const override
The CelestialSortFilterProxyModel class is a proxy used by both MapViewWidget's listview,...
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Sep 21 2023 04:12:25 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.