From 046503ba7830427fcd055da569326f0ac814b979 Mon Sep 17 00:00:00 2001 From: Arno Date: Fri, 5 Apr 2013 21:23:45 +0200 Subject: New Class: SmTreeView Code reusage: all 3 tabs had the same funtions: readHeaderConfig, writeHeaderConfig and toggleHeader, so turn it into a class derived from QTreeView. Unfortunately mATree didn't do things as later added Views, so it took some time to find the culprit in SheMov::readSettings :( Hopefully I didn't break too much... --- filestreewidget.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'filestreewidget.h') diff --git a/filestreewidget.h b/filestreewidget.h index 5068b91..6369300 100644 --- a/filestreewidget.h +++ b/filestreewidget.h @@ -9,11 +9,12 @@ #define FILESTREEWIDGET_H #include -#include #include #include #include +#include "smtreeview.h" + typedef QList PersistenModelIndexList; class FilesTreeView; @@ -64,17 +65,14 @@ class FilesTreeWidget : public QWidget { qint64 mSelectedSize; }; -class FilesTreeView : public QTreeView { +class FilesTreeView : public SmTreeView { Q_OBJECT public: explicit FilesTreeView(QWidget *parent = 0); - virtual void setModel(QAbstractItemModel *model); public slots: - void readSettings(); - void readHeaderConfig(); - void writeHeaderConfig(); - void toggleHeader(QObject *action); + void readSettings(); + void writeSettings(); protected: virtual void contextMenuEvent(QContextMenuEvent *event); -- cgit v1.2.3-70-g09d2