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... --- filepropertiesdialog.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'filepropertiesdialog.h') diff --git a/filepropertiesdialog.h b/filepropertiesdialog.h index d03eb86..ee9aa96 100644 --- a/filepropertiesdialog.h +++ b/filepropertiesdialog.h @@ -8,32 +8,27 @@ #ifndef FILEPROPERTIESDIALOG_H #define FILEPROPERTIESDIALOG_H -#include -#include - #include "smdialog.h" -class QPushButton; -class QTreeView; +class SmTreeView; class QLabel; class QTabWidget; class SmTreeModel; class MetadataWidget; -class QShowEvent; -class FilePropertiesDialog : public SmDialog -{ +class FilePropertiesDialog : public SmDialog { Q_OBJECT public: - explicit FilePropertiesDialog(int seriesPartId, QWidget *parent = 0, Qt::WindowFlags f = 0); + explicit FilePropertiesDialog(/*int seriesPartId, */QWidget *parent = 0, Qt::WindowFlags f = 0); void setFileName(const QString &fileName); void setStreamData(const QList > &streamData); void addData(const QString &caption, const QMap &data); + MetadataWidget *metaWidget() { return mMetadata; }; private: QTabWidget *mTab; MetadataWidget *mMetadata; - QTreeView *mView; + SmTreeView *mView; QPushButton *mOk; QPushButton *mCancel; QLabel *mDescriptionLabel; -- cgit v1.2.3-70-g09d2