umbrello  2.31.90
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
singlepagedialogbase.h
Go to the documentation of this file.
1 /***************************************************************************
2  * This program is free software; you can redistribute it and/or modify *
3  * it under the terms of the GNU General Public License as published by *
4  * the Free Software Foundation; either version 2 of the License, or *
5  * (at your option) any later version. *
6  * *
7  * copyright (C) 2012-2020 *
8  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9  ***************************************************************************/
10 
11 #ifndef SINGLEPAGEDIALOGBASE_H
12 #define SINGLEPAGEDIALOGBASE_H
13 
14 #include <QtGlobal>
15 
16 #if QT_VERSION >= 0x050000
17 #include <QDialog>
18 class QAbstractButton;
19 class QDialogButtonBox;
20 #else
21 #include <KDialog>
22 #endif
23 
31 #if QT_VERSION >= 0x050000
32 class SinglePageDialogBase : public QDialog
33 #else
34 class SinglePageDialogBase : public KDialog
35 #endif
36 {
37  Q_OBJECT
38 public:
39  explicit SinglePageDialogBase(QWidget *parent, bool withApplyButton = false, bool withSearchButton = false);
40  virtual ~SinglePageDialogBase();
41  virtual bool apply();
42 
43 #if QT_VERSION >= 0x050000
44  typedef enum { Cancel = 0, Ok = 1, Apply = 2, No = 2 } ButtonCode;
45  // keep in sync with MultiPageDialogBase
46  void setCaption(const QString &caption);
47 
48  QWidget *mainWidget();
49  void setMainWidget(QWidget *widget);
50  void setButtonText(ButtonCode code, const QString &text);
51 #endif
52 
53 protected slots:
54  void slotApply();
55  void slotOk();
56 #if QT_VERSION >= 0x050000
57  void slotCancel();
58  void slotClicked(QAbstractButton*);
59 #endif
60 
61 protected:
62 #if QT_VERSION >= 0x050000
63  QDialogButtonBox *m_buttonBox;
64  QWidget *m_mainWidget;
65  void enableButtonOk(bool enable);
66 #endif
67  virtual bool validate();
68 };
69 
70 #endif
Definition: singlepagedialogbase.h:36
virtual bool validate()
Definition: singlepagedialogbase.cpp:215
void slotOk()
Definition: singlepagedialogbase.cpp:167
SinglePageDialogBase(QWidget *parent, bool withApplyButton=false, bool withSearchButton=false)
Definition: singlepagedialogbase.cpp:50
void slotApply()
Definition: singlepagedialogbase.cpp:158
virtual ~SinglePageDialogBase()
Definition: singlepagedialogbase.cpp:70
virtual bool apply()
Definition: singlepagedialogbase.cpp:82