itom  4.1.0
widgetPropFigurePlugins.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, 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 WIDGETPROPFIGUREPLUGINS_H
24 #define WIDGETPROPFIGUREPLUGINS_H
25 
26 #include "abstractPropertyPageWidget.h"
27 
28 #include <QtGui>
29 #include <qstandarditemmodel.h>
30 #include <qitemdelegate.h>
31 
32 #include "../organizer/designerWidgetOrganizer.h"
33 
34 #include "ui_widgetPropFigurePlugins.h"
35 
36 namespace ito
37 {
38 
39 class FigurePluginDelegate; //forward declaration
40 
42 {
43  Q_OBJECT
44 
45 public:
46  WidgetPropFigurePlugins(QWidget *parent = NULL);
48 
49  void readSettings();
50  void writeSettings();
51 
52 protected:
53  void init();
54 
55 private:
56  Ui::WidgetPropFigurePlugins ui;
57 
58  QStandardItemModel *m_loadedFiguresModel;
59  QStandardItemModel *m_figureCategoryModel;
60  FigurePluginDelegate *m_delegate;
61 
62 signals:
63 
64 public slots:
65  void on_btnResetDefaultFigures_clicked();
66 
67 private slots:
68 
69 };
70 
71 
72 class FigurePluginDelegate : public QItemDelegate
73 {
74  Q_OBJECT
75 public:
76  FigurePluginDelegate(QObject *parent = 0);
77 
78  void append(int rowIndex, const FigureCategory &figureCategory);
79 
80  QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
81 
82  void setEditorData(QWidget *editor, const QModelIndex &index) const;
83  void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
84 
85  void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;
86 
87 private:
88  QMap<int, FigureCategory> m_figureCategories;
89  QMap<int, QStringList> m_possibleClassNames;
90 
91 
92 };
93 
94 
95 } //end namespace ito
96 
97 #endif
Definition: abstractPropertyPageWidget.h:31
Definition: designerWidgetOrganizer.h:52
void writeSettings()
Definition: widgetPropFigurePlugins.cpp:180
Definition: apiFunctionsGraph.cpp:39
Definition: widgetPropFigurePlugins.h:72
void readSettings()
Definition: widgetPropFigurePlugins.cpp:154
Definition: widgetPropFigurePlugins.h:41