From a39a1118320c2c2e291f9e771ab75d32549431a7 Mon Sep 17 00:00:00 2001 From: Arno Date: Wed, 10 Apr 2013 21:36:26 +0200 Subject: Fix setAlternatignRowColors Well, what started as a try to simplify QTreeView ended in a mass header murder... What happened: * I searched for a way to let every QTreeView honor the setAlternatingRowcolors() setting. Unfortunately it isn't enough to just set the global palette and set it to true. So every QTreeView is now derived from SmTreeView * SmTreeView registers itself with SmGlobals, so the property is set _after_ it's constructed. It's definitely not enough to call it in the constructor. I guess that's a bug. But it's enough to append the SmTreeView to a QList in SmGlobals and call it _after_ the painting is done. * As an added Bonus we can add virt. funcs to every SmTreeView at will While at it I realized that most of the included headers were void, so remove them. No idea what impact it has on the bin size... --- dbanalyzer.h | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'dbanalyzer.h') diff --git a/dbanalyzer.h b/dbanalyzer.h index eec9f5a..cc88bbc 100644 --- a/dbanalyzer.h +++ b/dbanalyzer.h @@ -9,18 +9,13 @@ #define DBANALYZER_H #include -#include -#include -#include #include #include #include #include -class QSqlQuery; class QTabWidget; -class QTreeView; -class QPushButton; +class SmTreeView; class SmTreeModel; class DbAnalyzer; class QLabel; @@ -50,13 +45,13 @@ class DbAnalyzerDialog : public QDialog { void deleteMarks(); private: - void populate(QTreeView *view ,SmTreeModel *model, const QList > &data, const QHash &marks = QHash()); + void populate(SmTreeView *view ,SmTreeModel *model, const QList > &data, const QHash &marks = QHash()); const QList currentIds() const; QTabWidget *mTab; - QTreeView *mNoActorsV; - QTreeView *mNoCoversV; - QTreeView *mStrayActorsV; - QTreeView *mStrayGenresV; + SmTreeView *mNoActorsV; + SmTreeView *mNoCoversV; + SmTreeView *mStrayActorsV; + SmTreeView *mStrayGenresV; SmTreeModel *mNoActorsM; SmTreeModel *mNoCoversM; SmTreeModel *mStrayActorsM; @@ -70,7 +65,7 @@ class DbAnalyzerDialog : public QDialog { QList mTotals; DbAnalyzer *mAnalyzer; int mMarkMode; - QTreeView *mCurrentView; + SmTreeView *mCurrentView; QStackedLayout *mButtonStack; }; -- cgit v1.2.3-70-g09d2