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/**
20 * @brief The CelestialSortFilterProxyModel class is a proxy used by both
21 * MapViewWidget's listview, and MapChangeEditDialog's listview.
22 */
24{
26
27public:
30 /**
31 * @brief A small trick to change names for dwarfs and moons
32 */
33 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
34
35private:
36 void setupPriorities();
37 void setupMoonsList();
38 void setupDwarfsList();
39
40protected:
41 bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
42
43private:
44 QMap<QString, int> m_priority;
45 QList<QString> m_moons;
46 QList<QString> m_dwarfs;
47};
48}
49
50#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 Fri Nov 8 2024 12:02:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.