itom 1.2.0
|
00001 /* ******************************************************************** 00002 itom software 00003 URL: http://www.uni-stuttgart.de/ito 00004 Copyright (C) 2013, Institut für Technische Optik (ITO), 00005 Universität Stuttgart, Germany 00006 00007 This file is part of itom. 00008 00009 itom is free software; you can redistribute it and/or modify it 00010 under the terms of the GNU Library General Public Licence as published by 00011 the Free Software Foundation; either version 2 of the Licence, or (at 00012 your option) any later version. 00013 00014 itom is distributed in the hope that it will be useful, but 00015 WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library 00017 General Public Licence for more details. 00018 00019 You should have received a copy of the GNU Library General Public License 00020 along with itom. If not, see <http://www.gnu.org/licenses/>. 00021 *********************************************************************** */ 00022 00023 #ifndef USERUIDIALOG 00024 #define USERUIDIALOG 00025 00026 #include "../common/sharedStructuresQt.h" 00027 #include "../api/apiFunctionsGraph.h" 00028 00029 #include <qdialog.h> 00030 00031 #include <qstring.h> 00032 #include <qmap.h> 00033 #include <QBoxLayout> 00034 #include <qdialogbuttonbox.h> 00035 #include <qabstractbutton.h> 00036 00037 #include <qstringlist.h> 00038 #include <qmetaobject.h> 00039 00040 using namespace ito; 00041 00042 class UserUiDialog : public QDialog 00043 { 00044 Q_OBJECT 00045 public: 00046 enum tButtonBarType 00047 { 00048 bbTypeNo = 0x0000, 00049 bbTypeHorizontal = 0x0001, 00050 bbTypeVertical = 0x0002 00051 }; 00052 00053 UserUiDialog(QString filename, tButtonBarType buttonBarType, QMap<QString,QString> &dialogButtons, RetVal &retValue, QWidget * parent = NULL, Qt::WindowFlags f = NULL); 00054 UserUiDialog(QWidget *contentWidget, tButtonBarType buttonBarType, QMap<QString,QString> &dialogButtons, RetVal &retValue, QWidget * parent = NULL, Qt::WindowFlags f = NULL); 00055 00056 ~UserUiDialog(); 00057 00058 const QMetaObject *getMetaObjectByWidgetName(QString name) const; 00059 00060 protected: 00061 RetVal init(QString filename, tButtonBarType buttonBarType, QMap<QString,QString> &dialogButtons); 00062 RetVal init(QWidget *contentWidget, tButtonBarType buttonBarType, QMap<QString,QString> &dialogButtons); 00063 00064 private: 00065 00066 00067 QDialogButtonBox::ButtonRole getButtonRole(QString role); 00068 00069 QBoxLayout *m_boxLayout; 00070 QDialogButtonBox *m_dialogBtnBox; 00071 QWidget *m_uiWidget; 00072 00073 signals: 00074 00075 public slots: 00076 00077 private slots: 00078 void dialogButtonClicked ( QAbstractButton * button ); 00079 }; 00080 00081 #endif