itom  3.0.0
dialogProperties.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2016, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom.
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  itom is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17  General Public Licence for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with itom. If not, see <http://www.gnu.org/licenses/>.
21 *********************************************************************** */
22 
23 #ifndef DIALOGPROPERTIES_H
24 #define DIALOGPROPERTIES_H
25 
26 #include "abstractPropertyPageWidget.h"
27 
28 #include <QtGui>
29 #include <qdialog.h>
30 #include <qmap.h>
31 #include <qtreewidget.h>
32 #include <qstringlist.h>
33 #include <qstackedwidget.h>
34 #include <qsplitter.h>
35 #include <qdialogbuttonbox.h>
36 #include <qlayout.h>
37 #include <qlabel.h>
38 
39 namespace ito
40 {
41 
42 class DialogProperties : public QDialog
43 {
44  Q_OBJECT
45 
46 public:
47 
48  struct PropertyPage
49  {
50  PropertyPage() : m_widget(NULL), m_icon(), m_visited(false) {}
51  PropertyPage(QString name, QString title, QString fullname, AbstractPropertyPageWidget* widget, QIcon icon) : m_title(title), m_name(name), m_fullname(fullname), m_widget(widget), m_icon(icon), m_visited(false) {}
52  QString m_title;
53  QString m_name;
54  QString m_fullname;
56  QIcon m_icon;
57  bool m_visited;
58  };
59 
60  DialogProperties(QWidget * parent = 0, Qt::WindowFlags f = 0);
62 
63  bool selectTabByKey(QString &key, QTreeWidgetItem *parent = NULL);
64 
65 protected:
66  void initPages();
67 
68  void addPage(PropertyPage page, QTreeWidgetItem *parent, QStringList remainingPathes);
69 
70 private:
71  QStackedWidget *m_pStackedWidget;
72  QSplitter *m_pSplitter;
73  QTreeWidget *m_pCategories;
74  QDialogButtonBox *m_pButtonBox;
75 
76  QHBoxLayout *m_pHorizontalLayout;
77  QVBoxLayout *m_pVerticalLayout;
78 
79  QLabel *m_pPageTitle;
80  QFrame *m_pLine;
81  QWidget *m_pEmptyPage;
82 
83  QString m_CurrentPropertyKey;
84 
85  QMap<QString, PropertyPage> m_pages;
86 
87 signals:
88  void propertiesChanged();
89 
90 public slots:
91 
92 private slots:
93  void categoryChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
94  void accepted();
95  void rejected();
96  void apply();
97 };
98 
99 } //end namespace ito
100 
101 #endif
Definition: abstractPropertyPageWidget.h:31
Definition: apiFunctionsGraph.cpp:39
Definition: dialogProperties.h:48
Definition: dialogProperties.h:42