umbrello 2.34.70-5524f40e1
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 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2012-2020 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef SINGLEPAGEDIALOGBASE_H
7#define SINGLEPAGEDIALOGBASE_H
8
9#include <QtGlobal>
10
11#if QT_VERSION >= 0x050000
12#include <QDialog>
13class QAbstractButton;
14class QDialogButtonBox;
15#else
16#include <KDialog>
17#endif
18
26#if QT_VERSION >= 0x050000
27class SinglePageDialogBase : public QDialog
28#else
29class SinglePageDialogBase : public KDialog
30#endif
31{
32 Q_OBJECT
33public:
34 explicit SinglePageDialogBase(QWidget *parent, bool withApplyButton = false, bool withSearchButton = false);
35 virtual ~SinglePageDialogBase();
36 virtual bool apply();
37
38#if QT_VERSION >= 0x050000
39 typedef enum { Cancel = 0, Ok = 1, Apply = 2, No = 2 } ButtonCode;
40 // keep in sync with MultiPageDialogBase
41 void setCaption(const QString &caption);
42
43 QWidget *mainWidget();
44 void setMainWidget(QWidget *widget);
45 void setButtonText(ButtonCode code, const QString &text);
46#endif
47
48protected slots:
49 void slotApply();
50 void slotOk();
51#if QT_VERSION >= 0x050000
52 void slotCancel();
53 void slotClicked(QAbstractButton*);
54#endif
55
56protected:
57#if QT_VERSION >= 0x050000
58 QDialogButtonBox *m_buttonBox;
59 QWidget *m_mainWidget;
60 void enableButtonOk(bool enable);
61#endif
62 virtual bool validate();
63};
64
65#endif
Definition: singlepagedialogbase.h:31
virtual bool validate()
Definition: singlepagedialogbase.cpp:214
void slotOk()
Definition: singlepagedialogbase.cpp:166
SinglePageDialogBase(QWidget *parent, bool withApplyButton=false, bool withSearchButton=false)
Definition: singlepagedialogbase.cpp:48
void slotApply()
Definition: singlepagedialogbase.cpp:157
virtual ~SinglePageDialogBase()
Definition: singlepagedialogbase.cpp:68
virtual bool apply()
Definition: singlepagedialogbase.cpp:80