Qt 4.8
qt-4.8.6
src
gui
widgets
qdialogbuttonbox.h
Go to the documentation of this file.
1
/****************************************************************************
2
**
3
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4
** Contact: http://www.qt-project.org/legal
5
**
6
** This file is part of the QtGui module of the Qt Toolkit.
7
**
8
** $QT_BEGIN_LICENSE:LGPL$
9
** Commercial License Usage
10
** Licensees holding valid commercial Qt licenses may use this file in
11
** accordance with the commercial license agreement provided with the
12
** Software or, alternatively, in accordance with the terms contained in
13
** a written agreement between you and Digia. For licensing terms and
14
** conditions see http://qt.digia.com/licensing. For further information
15
** use the contact form at http://qt.digia.com/contact-us.
16
**
17
** GNU Lesser General Public License Usage
18
** Alternatively, this file may be used under the terms of the GNU Lesser
19
** General Public License version 2.1 as published by the Free Software
20
** Foundation and appearing in the file LICENSE.LGPL included in the
21
** packaging of this file. Please review the following information to
22
** ensure the GNU Lesser General Public License version 2.1 requirements
23
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24
**
25
** In addition, as a special exception, Digia gives you certain additional
26
** rights. These rights are described in the Digia Qt LGPL Exception
27
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28
**
29
** GNU General Public License Usage
30
** Alternatively, this file may be used under the terms of the GNU
31
** General Public License version 3.0 as published by the Free Software
32
** Foundation and appearing in the file LICENSE.GPL included in the
33
** packaging of this file. Please review the following information to
34
** ensure the GNU General Public License version 3.0 requirements will be
35
** met: http://www.gnu.org/copyleft/gpl.html.
36
**
37
**
38
** $QT_END_LICENSE$
39
**
40
****************************************************************************/
41
42
#ifndef QDIALOGBUTTONBOX_H
43
#define QDIALOGBUTTONBOX_H
44
45
#include <QtGui/qwidget.h>
46
47
QT_BEGIN_HEADER
48
49
QT_BEGIN_NAMESPACE
50
51
QT_MODULE
(Gui)
52
53
class
QAbstractButton
;
54
class
QPushButton
;
55
class
QDialogButtonBoxPrivate
;
56
57
class
Q_GUI_EXPORT
QDialogButtonBox
:
public
QWidget
58
{
59
Q_OBJECT
60
Q_FLAGS
(StandardButtons)
61
Qt
::
Orientation
orientation;
62
StandardButtons standardButtons;
63
bool
centerButtons;
64
65
public:
66
enum
ButtonRole
{
67
// keep this in sync with QMessageBox::ButtonRole
68
InvalidRole = -1,
69
AcceptRole
,
70
RejectRole
,
71
DestructiveRole
,
72
ActionRole
,
73
HelpRole
,
74
YesRole
,
75
NoRole
,
76
ResetRole
,
77
ApplyRole
,
78
79
NRoles
80
};
81
82
enum
StandardButton
{
83
// keep this in sync with QMessageBox::StandardButton
84
NoButton
= 0x00000000,
85
Ok
= 0x00000400,
86
Save = 0x00000800,
87
SaveAll = 0x00001000,
88
Open = 0x00002000,
89
Yes = 0x00004000,
90
YesToAll = 0x00008000,
91
No = 0x00010000,
92
NoToAll = 0x00020000,
93
Abort
= 0x00040000,
94
Retry = 0x00080000,
95
Ignore = 0x00100000,
96
Close = 0x00200000,
97
Cancel = 0x00400000,
98
Discard
= 0x00800000,
99
Help = 0x01000000,
100
Apply = 0x02000000,
101
Reset = 0x04000000,
102
RestoreDefaults = 0x08000000,
103
104
#ifndef Q_MOC_RUN
105
FirstButton =
Ok
,
106
LastButton = RestoreDefaults
107
#endif
108
};
109
110
Q_DECLARE_FLAGS
(StandardButtons,
StandardButton
)
111
112
enum
ButtonLayout
{
113
WinLayout
,
114
MacLayout
,
115
KdeLayout
,
116
GnomeLayout
117
};
118
119
QDialogButtonBox
(
QWidget
*parent = 0);
120
QDialogButtonBox
(
Qt::Orientation
orientation,
QWidget
*parent = 0);
121
QDialogButtonBox
(StandardButtons
buttons
,
Qt::Orientation
orientation =
Qt::Horizontal
,
122
QWidget
*parent = 0);
123
~
QDialogButtonBox
();
124
125
void
setOrientation(
Qt::Orientation
orientation);
126
Qt::Orientation
orientation()
const
;
127
128
void
addButton(
QAbstractButton
*button,
ButtonRole
role);
129
QPushButton
*addButton(
const
QString
&
text
,
ButtonRole
role);
130
QPushButton
*addButton(
StandardButton
button);
131
void
removeButton(
QAbstractButton
*button);
132
void
clear
();
133
134
QList<QAbstractButton *>
buttons
()
const
;
135
ButtonRole
buttonRole(
QAbstractButton
*button)
const
;
136
137
void
setStandardButtons(StandardButtons
buttons
);
138
StandardButtons standardButtons()
const
;
139
StandardButton
standardButton(
QAbstractButton
*button)
const
;
140
QPushButton
*button(
StandardButton
which)
const
;
141
142
void
setCenterButtons(
bool
center
);
143
bool
centerButtons()
const
;
144
145
Q_SIGNALS
:
146
void
clicked(
QAbstractButton
*button);
147
void
accepted();
148
void
helpRequested();
149
void
rejected();
150
151
protected
:
152
void
changeEvent
(
QEvent
*
event
);
153
bool
event
(
QEvent
*
event
);
154
155
private
:
156
Q_DISABLE_COPY
(
QDialogButtonBox
)
157
Q_DECLARE_PRIVATE
(
QDialogButtonBox
)
158
Q_PRIVATE_SLOT
(d_func(),
void
_q_handleButtonClicked())
159
Q_PRIVATE_SLOT
(d_func(),
void
_q_handleButtonDestroyed())
160
};
161
162
Q_DECLARE_OPERATORS_FOR_FLAGS
(
QDialogButtonBox
::StandardButtons)
163
164
QT_END_NAMESPACE
165
166
QT_END_HEADER
167
168
#endif // QDIALOGBUTTONBOX_H
QAbstractButton
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
Definition:
qabstractbutton.h:58
QDialogButtonBox::DestructiveRole
Definition:
qdialogbuttonbox.h:71
QT_END_NAMESPACE
#define QT_END_NAMESPACE
This macro expands to.
Definition:
qglobal.h:90
event
EventRef event
Definition:
qapplication_mac.mm:880
QT_MODULE
#define QT_MODULE(x)
Definition:
qglobal.h:2783
Qt::Horizontal
Definition:
qnamespace.h:175
QT_BEGIN_HEADER
#define QT_BEGIN_HEADER
Definition:
qglobal.h:136
Q_DECLARE_FLAGS
#define Q_DECLARE_FLAGS(Flags, Enum)
The Q_DECLARE_FLAGS() macro expands to.
Definition:
qglobal.h:2348
Q_GUI_EXPORT
#define Q_GUI_EXPORT
Definition:
qglobal.h:1450
Discard
Definition:
qbezier.cpp:260
buttons
static Qt::MouseButtons buttons
Definition:
qapplication_qpa.cpp:87
QWidget
The QWidget class is the base class of all user interface objects.
Definition:
qwidget.h:150
clear
static void clear(QVariant::Private *d)
Definition:
qvariant.cpp:197
QPushButton
The QPushButton widget provides a command button.
Definition:
qpushbutton.h:57
Q_DISABLE_COPY
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
Definition:
qglobal.h:2523
Q_PRIVATE_SLOT
#define Q_PRIVATE_SLOT(d, signature)
Definition:
qobjectdefs.h:73
QDialogButtonBox::NoRole
Definition:
qdialogbuttonbox.h:75
QString
The QString class provides a Unicode character string.
Definition:
qstring.h:83
QDialogButtonBox::ResetRole
Definition:
qdialogbuttonbox.h:76
QDialogButtonBox::HelpRole
Definition:
qdialogbuttonbox.h:73
Q_SIGNALS
#define Q_SIGNALS
Definition:
qobjectdefs.h:72
QDialogButtonBox::ActionRole
Definition:
qdialogbuttonbox.h:72
QT_BEGIN_NAMESPACE
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition:
qglobal.h:89
Q_DECLARE_OPERATORS_FOR_FLAGS
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
The Q_DECLARE_OPERATORS_FOR_FLAGS() macro declares global operator|() functions for Flags...
Definition:
qglobal.h:2355
QDialogButtonBoxPrivate
Definition:
qdialogbuttonbox.cpp:291
QWidget::changeEvent
virtual void changeEvent(QEvent *)
This event handler can be reimplemented to handle state changes.
Definition:
qwidget.cpp:9170
QDialogButtonBox::YesRole
Definition:
qdialogbuttonbox.h:74
Q_OBJECT
#define Q_OBJECT
Definition:
qobjectdefs.h:157
QDialogButtonBox::AcceptRole
Definition:
qdialogbuttonbox.h:69
center
Q_CORE_EXPORT QTextStream & center(QTextStream &s)
Qt::NoButton
Definition:
qnamespace.h:151
Ok
Definition:
qbezier.cpp:259
QDialogButtonBox::StandardButton
StandardButton
These enums describe flags for standard buttons.
Definition:
qdialogbuttonbox.h:82
QDialogButtonBox::WinLayout
Definition:
qdialogbuttonbox.h:113
QDialogButtonBox
The QDialogButtonBox class is a widget that presents buttons in a layout that is appropriate to the c...
Definition:
qdialogbuttonbox.h:57
Qt
Definition:
qnamespace.h:54
QDialogButtonBox::ButtonRole
ButtonRole
This enum describes the roles that can be used to describe buttons in the button box.
Definition:
qdialogbuttonbox.h:66
QTest::Abort
Definition:
qtest_global.h:83
Q_FLAGS
#define Q_FLAGS(x)
Definition:
qobjectdefs.h:85
QDialogButtonBox::ButtonLayout
ButtonLayout
This enum describes the layout policy to be used when arranging the buttons contained in the button b...
Definition:
qdialogbuttonbox.h:112
Q_DECLARE_PRIVATE
#define Q_DECLARE_PRIVATE(Class)
Definition:
qglobal.h:2467
QDialogButtonBox::ApplyRole
Definition:
qdialogbuttonbox.h:77
QWidget::event
bool event(QEvent *)
This is the main event handler; it handles event event.
Definition:
qwidget.cpp:8636
QDialogButtonBox::KdeLayout
Definition:
qdialogbuttonbox.h:115
Qt::Orientation
Orientation
Definition:
qnamespace.h:174
QEvent
The QEvent class is the base class of all event classes.
Definition:
qcoreevent.h:56
QT_END_HEADER
#define QT_END_HEADER
Definition:
qglobal.h:137
text
#define text
Definition:
qobjectdefs.h:80
QDialogButtonBox::RejectRole
Definition:
qdialogbuttonbox.h:70
QList
The QList class is a template class that provides lists.
Definition:
qdatastream.h:62
QDialogButtonBox::MacLayout
Definition:
qdialogbuttonbox.h:114
Qt 4.8 Source Code Browser