File indexing completed on 2024-12-15 03:45:01
0001 /* 0002 SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: MIT 0005 */ 0006 0007 #ifndef KUSERFEEDBACK_CONSOLE_EXTRAROWSPROXYMODEL_H 0008 #define KUSERFEEDBACK_CONSOLE_EXTRAROWSPROXYMODEL_H 0009 0010 #include <QIdentityProxyModel> 0011 0012 namespace KUserFeedback { 0013 namespace Console { 0014 0015 class ExtraRowsProxyModel : public QIdentityProxyModel 0016 { 0017 Q_OBJECT 0018 public: 0019 explicit ExtraRowsProxyModel(QObject *parent = nullptr); 0020 ~ExtraRowsProxyModel() override; 0021 0022 int rowCount(const QModelIndex &parent = QModelIndex()) const override; 0023 QVariant data(const QModelIndex & index, int role) const override; 0024 QModelIndex index(int row, int column, const QModelIndex &parent) const override; 0025 QModelIndex parent(const QModelIndex & child) const override; 0026 0027 protected: 0028 virtual QVariant extraData(int row, int column, int role) const; 0029 0030 private: 0031 int m_extraRowCount = 1; 0032 }; 0033 0034 }} 0035 0036 #endif // KUSERFEEDBACK_CONSOLE_EXTRAROWSPROXYMODEL_H