3 #include <widgets/tgscrollarea.h>
7 #include <QAbstractItemModel>
14 Q_PROPERTY(
bool wrapRows READ wrapRows WRITE setWrapRows NOTIFY wrapRowsChanged)
15 Q_PROPERTY(
bool alternatingRowColors READ alternatingRowColors WRITE setAlternatingRowColors NOTIFY alternatingRowColorsChanged)
16 Q_PROPERTY(
Tg::Color alternativeBackgroundColor READ alternativeBackgroundColor WRITE setAlternativeBackgroundColor NOTIFY alternativeBackgroundColorChanged)
17 Q_PROPERTY(qsizetype currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
18 Q_PROPERTY(
Tg::Color currentIndexColor READ currentIndexColor WRITE setCurrentIndexColor NOTIFY currentIndexColorChanged)
19 Q_PROPERTY(QAbstractItemModel* model READ model WRITE setModel NOTIFY modelChanged)
25 QAbstractItemModel *model()
const;
26 void setModel(QAbstractItemModel *model);
28 bool wrapRows()
const;
29 bool alternatingRowColors()
const;
30 Tg::Color alternativeBackgroundColor()
const;
32 qsizetype currentIndex()
const;
36 void setWrapRows(
const bool wrapRows);
37 void setAlternatingRowColors(
const bool alternatingRowColors);
38 void setAlternativeBackgroundColor(
const Tg::Color &alternativeBackgroundColor);
39 void setCurrentIndex(
const qsizetype currentIndex);
40 void setCurrentIndexColor(
const Tg::Color ¤tIndexColor);
43 void wrapRowsChanged(
const bool wrapRows)
const;
44 void alternatingRowColorsChanged(
const bool alternatingRowColors)
const;
45 void modelChanged(QAbstractItemModel* model)
const;
46 void alternativeBackgroundColorChanged(
const Tg::Color &alternativeBackgroundColor)
const;
47 void currentIndexChanged(
const qsizetype currentIndex)
const;
48 void currentIndexColorChanged(
const Tg::Color ¤tIndexColor)
const;
53 QString drawAreaContents(
const QPoint &pixel)
const override;
55 QString getLine(
const int row)
const;
56 QString getLine(
const QModelIndex index)
const;
59 void updateChildrenDimensions()
override;
62 QPointer<QAbstractItemModel> _model;
63 bool _wrapRows =
false;
64 bool _alternatingRowColors =
false;
67 qsizetype _currentIndex = 0;