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... --- filesystemwidget.h | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'filesystemwidget.h') diff --git a/filesystemwidget.h b/filesystemwidget.h index eaa6348..62c42db 100644 --- a/filesystemwidget.h +++ b/filesystemwidget.h @@ -9,25 +9,17 @@ #define FILESYSTEMWIDGET_H #include -#include #include -#include #include #include -class QTreeView; +class SmTreeView; class FilesystemDirProxy; class FileView; -class QModelIndex; class FilesystemFileProxy; class QLineEdit; -class QFileInfo; -class QAction; -class QVariant; class PictureViewer2; -class QStringList; class FileSystemModel; -class QSqlQuery; class SheMovIconProvider; class SmDirModel; @@ -39,7 +31,7 @@ class FilesystemWidget : public QWidget { ~FilesystemWidget() {} FileView *fileView() { return mFileView; } FilesystemFileProxy *fileProxy() { return mFileProxy; } - FileSystemModel *dirModel() { return mModel; } + FileSystemModel *dirModel() { return mModel; } SmDirModel *fileModel() { return mFileModel; } const QString windowTitle() const { return mWindowTitle; } PictureViewer2 *pictureViewer() { return mPicViewer; } @@ -84,9 +76,9 @@ class FilesystemWidget : public QWidget { QPair programData(const QString &prefix, const QString &preferred); QStringList selectedFiles(); QStringList mExpandedDirs; - FileSystemModel *mModel; + FileSystemModel *mModel; SmDirModel *mFileModel; - QTreeView *mDirView; + SmTreeView *mDirView; FileView *mFileView; FilesystemDirProxy *mDirProxy; FilesystemFileProxy *mFileProxy; @@ -104,7 +96,7 @@ class FileSystemModel : public QFileSystemModel { Q_OBJECT public: FileSystemModel(QObject *parent = 0); - ~FileSystemModel() {}; + ~FileSystemModel() {} public slots: void markForClipboard(const QPersistentModelIndex &idx); -- cgit v1.2.3-70-g09d2