summaryrefslogtreecommitdiff
path: root/src/modelutils.h
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2021-01-01 13:51:36 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2021-01-02 15:38:19 +0100
commite5f43788e874e638e1d4dbab20451c36e52df10d (patch)
tree9191bae2dce4cb69bd9c5bfa0099a4f8981a50d1 /src/modelutils.h
parentf36c68332019ec68a713b21519c0439039845fa1 (diff)
Visual fixes for the modlist.
- Fix invalid positions of markers in the scrollbar. - Use color from children for collapsed elements (background and markers).
Diffstat (limited to 'src/modelutils.h')
-rw-r--r--src/modelutils.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/modelutils.h b/src/modelutils.h
index b5becb6c..cb7c9394 100644
--- a/src/modelutils.h
+++ b/src/modelutils.h
@@ -3,16 +3,28 @@
#include <QAbstractItemView>
#include <QAbstractItemModel>
+#include <QColor>
+
+namespace MOShared {
// retrieve all the row index under the given parent
QModelIndexList flatIndex(
const QAbstractItemModel* model, int column = 0, const QModelIndex& parent = QModelIndex());
+// retrieve all the visible index in the given view
+QModelIndexList visibleIndex(QTreeView* view, int column = 0);
+
// convert back-and-forth through model proxies
QModelIndex indexModelToView(const QModelIndex& index, const QAbstractItemView* view);
QModelIndexList indexModelToView(const QModelIndexList& index, const QAbstractItemView* view);
QModelIndex indexViewToModel(const QModelIndex& index, const QAbstractItemModel* model);
QModelIndexList indexViewToModel(const QModelIndexList& index, const QAbstractItemModel* model);
+// retrieve the color of the children of the given index for the given, or an invalid
+// color if the item is expanded or the children do not have colors for the given role
+//
+QColor childrenColor(const QModelIndex& index, QTreeView* view, int role);
+
+}
#endif