diff options
author | Arno <am@disconnect.de> | 2013-04-05 21:23:45 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2013-04-05 21:23:45 +0200 |
commit | 046503ba7830427fcd055da569326f0ac814b979 (patch) | |
tree | d3404b51c054a9f4b4171bbd9641162e8c3333a1 /smtreeview.h | |
parent | 0f4f0d5860e4a261f37ae6f294c154c3009c4562 (diff) | |
download | SheMov-046503ba7830427fcd055da569326f0ac814b979.tar.gz SheMov-046503ba7830427fcd055da569326f0ac814b979.tar.bz2 SheMov-046503ba7830427fcd055da569326f0ac814b979.zip |
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...
Diffstat (limited to 'smtreeview.h')
-rw-r--r-- | smtreeview.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/smtreeview.h b/smtreeview.h new file mode 100644 index 0000000..eff41d5 --- /dev/null +++ b/smtreeview.h @@ -0,0 +1,32 @@ +/* + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. +*/ + +#ifndef SMTREEVIEW_H +#define SMTREEVIEW_H + +#include <QTreeView> + +class QActionGroup; + +class SmTreeView : public QTreeView { + Q_OBJECT + public: + SmTreeView(QWidget *parent = 0) : QTreeView(parent) {} + SmTreeView(const QString &hSetting, QWidget *parent = 0); + virtual void setHeaderGroup(QActionGroup *ag) { mHeaderGroup = ag; } + + public slots: + void readHeaderConfig(); + void writeHeaderConfig(); + void toggleHeader(QObject *action); + + private: + const QString mHeaderSetting; + QActionGroup *mHeaderGroup; +}; + +#endif // SMTREEVIEW_H |