File indexing completed on 2023-09-24 04:09:50
0001 /* 0002 This file is part of the proxy model test suite. 0003 0004 SPDX-FileCopyrightText: 2009 Stephen Kelly <steveire@gmail.com> 0005 0006 SPDX-License-Identifier: LGPL-2.1-or-later 0007 */ 0008 0009 #ifndef LESSTHANWIDGET_H 0010 #define LESSTHANWIDGET_H 0011 0012 #include <QItemSelectionModel> 0013 #include <QWidget> 0014 0015 #include "dynamictreemodel.h" 0016 0017 class ColoredTreeModel : public DynamicTreeModel 0018 { 0019 Q_OBJECT 0020 public: 0021 ColoredTreeModel(QObject *parent = nullptr); 0022 0023 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; 0024 0025 void setSelectionModel(QItemSelectionModel *selectionModel); 0026 0027 protected Q_SLOTS: 0028 void recolor(const QModelIndex &parent = QModelIndex()); 0029 0030 private: 0031 QItemSelectionModel *m_selectionModel; 0032 QColor m_lessThanColour; 0033 QColor m_greaterThanColour; 0034 }; 0035 0036 class LessThanWidget : public QWidget 0037 { 0038 Q_OBJECT 0039 public: 0040 LessThanWidget(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); 0041 0042 void insertGrid(QList<int> address); 0043 0044 private: 0045 ColoredTreeModel *m_coloredTreeModel; 0046 }; 0047 0048 #endif