itom  4.1.0
userUiDialog.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 USERUIDIALOG
24 #define USERUIDIALOG
25 
26 #include "../common/sharedStructuresQt.h"
27 #include "../api/apiFunctionsGraph.h"
28 #include "../global.h"
29 
30 #include <qdialog.h>
31 
32 #include <qstring.h>
33 #include <qmap.h>
34 #include <QBoxLayout>
35 #include <qdialogbuttonbox.h>
36 #include <qabstractbutton.h>
37 
38 #include <qstringlist.h>
39 #include <qmetaobject.h>
40 
41 namespace ito
42 {
43 
44 class UserUiDialog : public QDialog
45 {
46  Q_OBJECT
47 public:
49  {
50  bbTypeNo = 0x0000,
51  bbTypeHorizontal = 0x0001,
52  bbTypeVertical = 0x0002
53  };
54 
55  UserUiDialog(const QString &filename, tButtonBarType buttonBarType, const StringMap &dialogButtons, RetVal &retValue, QWidget * parent = NULL, Qt::WindowFlags f = NULL);
56  UserUiDialog(QWidget *contentWidget, tButtonBarType buttonBarType, const StringMap &dialogButtons, RetVal &retValue, QWidget * parent = NULL, Qt::WindowFlags f = NULL);
57 
58  ~UserUiDialog();
59 
60 protected:
61  RetVal init(const QString &filename, tButtonBarType buttonBarType, const StringMap &dialogButtons);
62  RetVal init(QWidget *contentWidget, tButtonBarType buttonBarType, const StringMap &dialogButtons);
63 
64 private:
65  QDialogButtonBox::ButtonRole getButtonRole(const QString &role);
66 
67  QBoxLayout *m_boxLayout;
68  QDialogButtonBox *m_dialogBtnBox;
69  QWidget *m_uiWidget;
70 
71 signals:
72 
73 public slots:
74 
75 private slots:
76  void dialogButtonClicked ( QAbstractButton * button );
77 };
78 
79 } //end namespace ito
80 
81 #endif
Class for managing status values (like errors or warning)
Definition: retVal.h:54
Definition: apiFunctionsGraph.cpp:39
Definition: userUiDialog.h:44
tButtonBarType
Definition: userUiDialog.h:48