Warning, file /education/kwordquiz/src/kwqsortfiltermodel.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002     SPDX-FileCopyrightText: 2007-2010 Peter Hedlund <peter.hedlund@kdemail.net>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef KWQSORTFILTERMODEL_H
0007 #define KWQSORTFILTERMODEL_H
0008 
0009 #include <QSortFilterProxyModel>
0010 
0011 /**
0012   @author Peter Hedlund <peter.hedlund@kdemail.net>
0013 */
0014 
0015 class KWQTableModel;
0016 
0017 class KWQSortFilterModel : public QSortFilterProxyModel
0018 {
0019   Q_OBJECT
0020   public:
0021     explicit KWQSortFilterModel(QObject *parent = nullptr);
0022 
0023     void setTableModel(KWQTableModel * sourceModel);
0024     KWQTableModel * sourceModel() const;
0025 
0026   public Q_SLOTS:
0027     void restoreNativeOrder();
0028     void shuffle();
0029 
0030   protected:
0031     bool lessThan(const QModelIndex & left, const QModelIndex & right) const override;
0032 
0033     // Disable from public calls; use setTableModel instead.
0034     //void setSourceModel(QAbstractItemModel *sourceModel);
0035 
0036   private:
0037     KWQTableModel * m_sourceModel;
0038 
0039     bool m_restoreNativeOrder;
0040     bool m_shuffle;
0041     QList<int> m_shuffleList;
0042 };
0043 
0044 #endif