Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qdialogbuttonbox.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include <QtCore/qhash.h>
5#include <QtWidgets/qpushbutton.h>
6#include <QtWidgets/qstyle.h>
7#include <QtWidgets/qlayout.h>
8#include <QtWidgets/qdialog.h>
9#include <QtWidgets/qapplication.h>
10#include <private/qwidget_p.h>
11#include <private/qguiapplication_p.h>
12#include <QtGui/qpa/qplatformdialoghelper.h>
13#include <QtGui/qpa/qplatformtheme.h>
14#include <QtGui/qaction.h>
15
16#include "qdialogbuttonbox.h"
17#include "qdialogbuttonbox_p.h"
18
20
116 : orientation(orient), buttonLayout(nullptr), center(false)
117{
118}
119
121{
122 Q_Q(QDialogButtonBox);
124 bool createNewLayout = buttonLayout == nullptr
125 || (orientation == Qt::Horizontal && qobject_cast<QVBoxLayout *>(buttonLayout) != 0)
126 || (orientation == Qt::Vertical && qobject_cast<QHBoxLayout *>(buttonLayout) != 0);
127 if (createNewLayout) {
128 delete buttonLayout;
131 else
133 }
134
135 int left, top, right, bottom;
139
140 if (!q->testAttribute(Qt::WA_WState_OwnSizePolicy)) {
143 sp.transpose();
144 q->setSizePolicy(sp);
145 q->setAttribute(Qt::WA_WState_OwnSizePolicy, false);
146 }
147}
148
150{
151 initLayout();
153}
154
156 bool reverse)
157{
158 int start = reverse ? buttonList.size() - 1 : 0;
159 int end = reverse ? -1 : buttonList.size();
160 int step = reverse ? -1 : 1;
161
162 for (int i = start; i != end; i += step) {
163 QAbstractButton *button = buttonList.at(i);
165 button->show();
166 }
167}
168
170{
171 Q_Q(QDialogButtonBox);
172 const int MacGap = 36 - 8; // 8 is the default gap between a widget and a spacer item
173
175 for (int i = buttonLayout->count() - 1; i >= 0; --i) {
177 if (QWidget *widget = item->widget())
178 widget->hide();
179 delete item;
180 }
181
182 int tmpPolicy = layoutPolicy;
183
184 static const int M = 5;
187 if (tmpPolicy == QDialogButtonBox::MacLayout) {
188 bool hasModalButton = false;
189 for (int i = 0; i < M; ++i) {
190 if (!buttonLists[ModalRoles[i]].isEmpty()) {
191 hasModalButton = true;
192 break;
193 }
194 }
195 if (!hasModalButton)
196 tmpPolicy = 4; // Mac modeless
197 }
198
199 const int *currentLayout = QPlatformDialogHelper::buttonLayout(
200 orientation, static_cast<QPlatformDialogHelper::ButtonLayout>(tmpPolicy));
201
202 if (center)
204
206
207 while (*currentLayout != QPlatformDialogHelper::EOL) {
208 int role = (*currentLayout & ~QPlatformDialogHelper::Reverse);
209 bool reverse = (*currentLayout & QPlatformDialogHelper::Reverse);
210
211 switch (role) {
213 if (!center)
215 break;
217 if (acceptRoleList.isEmpty())
218 break;
219 // Only the first one
220 QAbstractButton *button = acceptRoleList.first();
222 button->show();
223 }
224 break;
226 if (acceptRoleList.size() > 1)
227 addButtonsToLayout(acceptRoleList.mid(1), reverse);
228 break;
230 {
232
233 /*
234 Mac: Insert a gap on the left of the destructive
235 buttons to ensure that they don't get too close to
236 the help and action buttons (but only if there are
237 some buttons to the left of the destructive buttons
238 (and the stretch, whence buttonLayout->count() > 1
239 and not 0)).
240 */
241 if (tmpPolicy == QDialogButtonBox::MacLayout
242 && !list.isEmpty() && buttonLayout->count() > 1)
243 buttonLayout->addSpacing(MacGap);
244
245 addButtonsToLayout(list, reverse);
246
247 /*
248 Insert a gap between the destructive buttons and the
249 accept and reject buttons.
250 */
251 if (tmpPolicy == QDialogButtonBox::MacLayout && !list.isEmpty())
252 buttonLayout->addSpacing(MacGap);
253 }
254 break;
262 addButtonsToLayout(buttonLists[role], reverse);
263 }
264 ++currentLayout;
265 }
266
267 QWidget *lastWidget = nullptr;
268 q->setFocusProxy(nullptr);
269 for (int i = 0; i < buttonLayout->count(); ++i) {
271 if (QWidget *widget = item->widget()) {
272 if (lastWidget)
273 QWidget::setTabOrder(lastWidget, widget);
274 else
275 q->setFocusProxy(widget);
276 lastWidget = widget;
277 }
278 }
279
280 if (center)
282}
283
285 LayoutRule layoutRule)
286{
287 Q_Q(QDialogButtonBox);
288 int icon = 0;
289
290 switch (sbutton) {
293 break;
296 break;
299 break;
302 break;
305 break;
308 break;
311 break;
314 break;
317 break;
320 break;
323 break;
326 break;
329 break;
332 break;
335 break;
338 break;
341 break;
344 break;
346 return nullptr;
347 ;
348 }
349 QPushButton *button = new QPushButton(QGuiApplicationPrivate::platformTheme()->standardButtonText(sbutton), q);
350 QStyle *style = q->style();
351 if (style->styleHint(QStyle::SH_DialogButtonBox_ButtonsHaveIcons, nullptr, q) && icon != 0)
353 if (style != QApplication::style()) // Propagate style
354 button->setStyle(style);
358 qWarning("QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
359 else
360 addButton(button, static_cast<QDialogButtonBox::ButtonRole>(role), layoutRule);
361#if QT_CONFIG(shortcut)
362 const QKeySequence standardShortcut = QGuiApplicationPrivate::platformTheme()->standardButtonShortcut(sbutton);
363 if (!standardShortcut.isEmpty())
364 button->setShortcut(standardShortcut);
365#endif
366 return button;
367}
368
370 LayoutRule layoutRule, AddRule addRule)
371{
372 Q_Q(QDialogButtonBox);
374 switch (addRule) {
375 case AddRule::Connect:
381 break;
383 break;
384 }
385
386 switch (layoutRule) {
389 break;
391 break;
392 }
393}
394
395void QDialogButtonBoxPrivate::createStandardButtons(QDialogButtonBox::StandardButtons buttons)
396{
399 if (i & buttons)
401 i = i << 1;
402 }
404}
405
407{
408 for (auto &&[key, value] : std::as_const(standardButtonHash).asKeyValueRange()) {
410 if (!text.isEmpty())
411 key->setText(text);
412 }
413}
414
421 : QDialogButtonBox(Qt::Horizontal, parent)
422{
423}
424
431 : QWidget(*new QDialogButtonBoxPrivate(orientation), parent, { })
432{
433 d_func()->initLayout();
434}
435
445 : QDialogButtonBox(buttons, Qt::Horizontal, parent)
446{
447}
448
455QDialogButtonBox::QDialogButtonBox(StandardButtons buttons, Qt::Orientation orientation,
457 : QDialogButtonBox(orientation, parent)
458{
459 d_func()->createStandardButtons(buttons);
460}
461
466{
467 Q_D(QDialogButtonBox);
468
469 d->byPassEventFilter = true;
470
471 // QObjectPrivate::connect requires explicit disconnect in destructor
472 // otherwise the connection may kick in on child destruction and reach
473 // the parent's destroyed private object
474 d->disconnectAll();
475}
476
481
504
602{
603 return d_func()->orientation;
604}
605
607{
608 Q_D(QDialogButtonBox);
609 if (orientation == d->orientation)
610 return;
611
612 d->orientation = orientation;
613 d->resetLayout();
614}
615
622{
623 Q_D(QDialogButtonBox);
624 // Remove the created standard buttons, they should be in the other lists, which will
625 // do the deletion
626 d->standardButtonHash.clear();
627 for (int i = 0; i < NRoles; ++i) {
628 QList<QAbstractButton *> &list = d->buttonLists[i];
629 while (list.size()) {
633 delete button;
634 }
635 }
636}
637
644{
645 Q_D(const QDialogButtonBox);
646 return d->allButtons();
647}
648
650{
651 QList<QAbstractButton *> finalList;
652 for (int i = 0; i < QDialogButtonBox::NRoles; ++i) {
654 for (int j = 0; j < list.size(); ++j)
655 finalList.append(list.at(j));
656 }
657 return finalList;
658}
659
661{
662 return visibleButtons() << hiddenButtons.keys();
663}
664
672{
673 Q_D(const QDialogButtonBox);
674 for (int i = 0; i < NRoles; ++i) {
675 const QList<QAbstractButton *> &list = d->buttonLists[i];
676 for (int j = 0; j < list.size(); ++j) {
677 if (list.at(j) == button)
678 return ButtonRole(i);
679 }
680 }
681 return d->hiddenButtons.value(button, InvalidRole);
682}
683
690{
691 Q_D(QDialogButtonBox);
693}
694
696{
697 Q_Q(QDialogButtonBox);
698 if (!button)
699 return;
700
701 // Remove it from hidden buttons
703
704 // Remove it from the standard button hash first and then from the roles
705 standardButtonHash.remove(reinterpret_cast<QPushButton *>(button));
706 for (int i = 0; i < QDialogButtonBox::NRoles; ++i)
707 buttonLists[i].removeOne(button);
708
709 switch (rule) {
711 button->setParent(nullptr);
717 break;
719 break;
720 }
721}
722
735{
736 Q_D(QDialogButtonBox);
737 if (Q_UNLIKELY(role <= InvalidRole || role >= NRoles)) {
738 qWarning("QDialogButtonBox::addButton: Invalid ButtonRole, button not added");
739 return;
740 }
742 button->setParent(this);
743 d->addButton(button, role);
744}
745
754{
755 Q_D(QDialogButtonBox);
756 if (Q_UNLIKELY(role <= InvalidRole || role >= NRoles)) {
757 qWarning("QDialogButtonBox::addButton: Invalid ButtonRole, button not added");
758 return nullptr;
759 }
760 QPushButton *button = new QPushButton(text, this);
761 d->addButton(button, role);
762 return button;
763}
764
773{
774 Q_D(QDialogButtonBox);
775 return d->createButton(button);
776}
777
786void QDialogButtonBox::setStandardButtons(StandardButtons buttons)
787{
788 Q_D(QDialogButtonBox);
789 // Clear out all the old standard buttons, then recreate them.
790 qDeleteAll(d->standardButtonHash.keyBegin(), d->standardButtonHash.keyEnd());
791 d->standardButtonHash.clear();
792
793 d->createStandardButtons(buttons);
794}
795
796QDialogButtonBox::StandardButtons QDialogButtonBox::standardButtons() const
797{
798 Q_D(const QDialogButtonBox);
799 StandardButtons standardButtons = NoButton;
800 QHash<QPushButton *, StandardButton>::const_iterator it = d->standardButtonHash.constBegin();
801 while (it != d->standardButtonHash.constEnd()) {
802 standardButtons |= it.value();
803 ++it;
804 }
805 return standardButtons;
806}
807
815{
816 Q_D(const QDialogButtonBox);
817 return d->standardButtonHash.key(which);
818}
819
827{
828 Q_D(const QDialogButtonBox);
829 return d->standardButtonHash.value(static_cast<QPushButton *>(button));
830}
831
833{
834 Q_Q(QDialogButtonBox);
835 if (QAbstractButton *button = qobject_cast<QAbstractButton *>(q->sender())) {
836 // Can't fetch this *after* emitting clicked, as clicked may destroy the button
837 // or change its role. Now changing the role is not possible yet, but arguably
838 // both clicked and accepted/rejected/etc. should be emitted "atomically"
839 // depending on whatever role the button had at the time of the click.
840 const QDialogButtonBox::ButtonRole buttonRole = q->buttonRole(button);
842
843 emit q->clicked(button);
844
845 if (!guard)
846 return;
847
851 emit q->accepted();
852 break;
855 emit q->rejected();
856 break;
858 emit q->helpRequested();
859 break;
860 default:
861 break;
862 }
863 }
864}
865
867{
868 Q_Q(QDialogButtonBox);
869 if (QObject *object = q->sender())
870 removeButton(reinterpret_cast<QAbstractButton *>(object), RemoveRule::KeepConnections);
871}
872
874{
875 Q_D(QDialogButtonBox);
876 if (d->byPassEventFilter)
877 return false;
878
879 QAbstractButton *button = qobject_cast<QAbstractButton *>(object);
880 if (!button)
881 return false;
882
883
884 const QEvent::Type type = event->type();
886 return d->handleButtonShowAndHide(button, event);
887
888 return false;
889}
890
892{
893 Q_Q(QDialogButtonBox);
894
895 const QEvent::Type type = event->type();
896
897 switch (type) {
899 const QDialogButtonBox::ButtonRole role = q->buttonRole(button);
904 }
905 break;
906 }
909 const auto role = hiddenButtons.take(button);
913 }
914 break;
915 default: break;
916 }
917
918 return false;
919}
920
933{
934 Q_D(QDialogButtonBox);
935 if (d->center != center) {
936 d->center = center;
937 d->resetLayout();
938 }
939}
940
942{
943 Q_D(const QDialogButtonBox);
944 return d->center;
945}
946
951{
953
954 Q_D(QDialogButtonBox);
955 switch (event->type()) {
956 case QEvent::StyleChange: // Propagate style
957 if (!d->standardButtonHash.empty()) {
958 QStyle *newStyle = style();
959 const StandardButtonHash::iterator end = d->standardButtonHash.end();
960 for (StandardButtonHash::iterator it = d->standardButtonHash.begin(); it != end; ++it)
961 it.key()->setStyle(newStyle);
962 }
963#ifdef Q_OS_MAC
966#endif
967 d->resetLayout();
969 break;
970 default:
972 break;
973 }
974}
975
977{
978 Q_Q(QDialogButtonBox);
980 QPushButton *firstAcceptButton = acceptRoleList.isEmpty()
981 ? nullptr
982 : qobject_cast<QPushButton *>(acceptRoleList.at(0));
983
984 if (!firstAcceptButton)
985 return;
986
987 bool hasDefault = false;
988 QWidget *dialog = nullptr;
989 QWidget *p = q;
990 while (p && !p->isWindow()) {
991 p = p->parentWidget();
992 if ((dialog = qobject_cast<QDialog *>(p)))
993 break;
994 }
995
998
999 const auto pushButtons = parent->findChildren<QPushButton *>();
1000 for (QPushButton *pushButton : pushButtons) {
1001 if (pushButton->isDefault() && pushButton != firstAcceptButton) {
1002 hasDefault = true;
1003 break;
1004 }
1005 }
1006 if (!hasDefault && firstAcceptButton)
1007 firstAcceptButton->setDefault(true);
1008}
1009
1011{
1012 Q_Q(QDialogButtonBox);
1013 const auto buttons = q->findChildren<QAbstractButton *>();
1014 for (auto *button : buttons)
1016}
1017
1022{
1023 Q_D(QDialogButtonBox);
1024 switch (event->type()) {
1025 case QEvent::Show:
1026 d->ensureFirstAcceptIsDefault();
1027 break;
1028
1030 d->retranslateStrings();
1031 break;
1032
1033 default: break;
1034 }
1035
1036 return QWidget::event(event);
1037}
1038
1040
1041#include "moc_qdialogbuttonbox.cpp"
The QAbstractButton class is the abstract base class of button widgets, providing functionality commo...
void setShortcut(const QKeySequence &key)
void setIcon(const QIcon &icon)
void clicked(bool checked=false)
This signal is emitted when the button is activated (i.e., pressed down then released while the mouse...
static QStyle * style()
Returns the application's style object.
int count() const override
\reimp
void addWidget(QWidget *, int stretch=0, Qt::Alignment alignment=Qt::Alignment())
Adds widget to the end of this box layout, with a stretch factor of stretch and alignment alignment.
QLayoutItem * takeAt(int) override
\reimp
void addSpacing(int size)
Adds a non-stretchable space (a QSpacerItem) with size size to the end of this box layout.
void addStretch(int stretch=0)
Adds a stretchable space (a QSpacerItem) with zero minimum size and stretch factor stretch to the end...
QLayoutItem * itemAt(int) const override
\reimp
QList< QAbstractButton * > buttonLists[QDialogButtonBox::NRoles]
QList< QAbstractButton * > allButtons() const
QPushButton * createButton(QDialogButtonBox::StandardButton button, LayoutRule layoutRule=LayoutRule::DoLayout)
void removeButton(QAbstractButton *button, RemoveRule rule)
void addButton(QAbstractButton *button, QDialogButtonBox::ButtonRole role, LayoutRule layoutRule=LayoutRule::DoLayout, AddRule addRule=AddRule::Connect)
bool handleButtonShowAndHide(QAbstractButton *button, QEvent *event)
void createStandardButtons(QDialogButtonBox::StandardButtons buttons)
QDialogButtonBox::ButtonRole buttonRole(QAbstractButton *button) const
QDialogButtonBoxPrivate(Qt::Orientation orient)
QHash< QPushButton *, QDialogButtonBox::StandardButton > standardButtonHash
QList< QAbstractButton * > visibleButtons() const
QHash< QAbstractButton *, QDialogButtonBox::ButtonRole > hiddenButtons
QDialogButtonBox::ButtonLayout layoutPolicy
void addButtonsToLayout(const QList< QAbstractButton * > &buttonList, bool reverse)
The QDialogButtonBox class is a widget that presents buttons in a layout that is appropriate to the c...
bool centerButtons
whether the buttons in the button box are centered
void changeEvent(QEvent *event) override
\reimp
ButtonRole buttonRole(QAbstractButton *button) const
Returns the button role for the specified button.
void addButton(QAbstractButton *button, ButtonRole role)
Adds the given button to the button box with the specified role.
void setStandardButtons(StandardButtons buttons)
StandardButton
These enums describe flags for standard buttons.
QPushButton * button(StandardButton which) const
Returns the QPushButton corresponding to the standard button which, or \nullptr if the standard butto...
~QDialogButtonBox()
Destroys the button box.
ButtonLayout
This enum describes the layout policy to be used when arranging the buttons contained in the button b...
StandardButton standardButton(QAbstractButton *button) const
Returns the standard button enum value corresponding to the given button, or NoButton if the given bu...
Qt::Orientation orientation
the orientation of the button box
QDialogButtonBox(QWidget *parent=nullptr)
Constructs an empty, horizontal button box with the given parent.
void setOrientation(Qt::Orientation orientation)
void setCenterButtons(bool center)
bool eventFilter(QObject *object, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
QList< QAbstractButton * > buttons() const
Returns a list of all buttons that have been added to the button box.
StandardButtons standardButtons
collection of standard buttons in the button box
void clear()
Clears the button box, deleting all buttons within it.
void removeButton(QAbstractButton *button)
Removes button from the button box without deleting it and sets its parent to zero.
bool event(QEvent *event) override
\reimp
\inmodule QtCore
Definition qcoreevent.h:45
Type
This enum type defines the valid event types in Qt.
Definition qcoreevent.h:51
@ StyleChange
Definition qcoreevent.h:136
@ LanguageChange
Definition qcoreevent.h:123
@ HideToParent
Definition qcoreevent.h:86
@ MacSizeChange
Definition qcoreevent.h:217
@ ShowToParent
Definition qcoreevent.h:85
static QPlatformTheme * platformTheme()
The QHBoxLayout class lines up widgets horizontally.
Definition qboxlayout.h:78
\inmodule QtCore
Definition qhash.h:1135
\inmodule QtCore
Definition qhash.h:818
bool remove(const Key &key)
Removes the item that has the key from the hash.
Definition qhash.h:956
T take(const Key &key)
Removes the item with the key from the hash and returns the value associated with it.
Definition qhash.h:975
QList< Key > keys() const
Returns a list containing all the keys in the hash, in an arbitrary order.
Definition qhash.h:1076
bool contains(const Key &key) const noexcept
Returns true if the hash contains an item with the key; otherwise returns false.
Definition qhash.h:991
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition qhash.h:1283
The QKeySequence class encapsulates a key sequence as used by shortcuts.
bool isEmpty() const
Returns true if the key sequence is empty; otherwise returns false.
The QLayoutItem class provides an abstract item that a QLayout manipulates.
Definition qlayoutitem.h:25
void setContentsMargins(int left, int top, int right, int bottom)
Definition qlayout.cpp:288
Definition qlist.h:74
qsizetype size() const noexcept
Definition qlist.h:386
bool isEmpty() const noexcept
Definition qlist.h:390
T & first()
Definition qlist.h:628
T takeAt(qsizetype i)
Definition qlist.h:592
const_reference at(qsizetype i) const noexcept
Definition qlist.h:429
QList< T > mid(qsizetype pos, qsizetype len=-1) const
Definition qlist.h:968
void append(parameter_type t)
Definition qlist.h:441
QObject * parent
Definition qobject.h:61
static QMetaObject::Connection connect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection)
Definition qobject_p.h:298
static bool disconnect(const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot)
Definition qobject_p.h:327
\inmodule QtCore
Definition qobject.h:90
void installEventFilter(QObject *filterObj)
Installs an event filter filterObj on this object.
Definition qobject.cpp:2269
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
Definition qobject.cpp:2521
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
Definition qobject.cpp:3099
void removeEventFilter(QObject *obj)
Removes an event filter object obj from this object.
Definition qobject.cpp:2300
QList< T > findChildren(const QString &aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
Returns all children of this object with the given name that can be cast to type T,...
Definition qobject.h:140
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
The QPlatformDialogHelper class allows for platform-specific customization of dialogs.
static const int * buttonLayout(Qt::Orientation orientation=Qt::Horizontal, ButtonLayout policy=UnknownLayout)
static ButtonRole buttonRole(StandardButton button)
virtual QString standardButtonText(int button) const
Returns the text of a standard button.
\inmodule QtCore
Definition qpointer.h:18
The QPushButton widget provides a command button.
Definition qpushbutton.h:20
void setDefault(bool)
bool isDefault() const
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
Definition qsizepolicy.h:18
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition qstring.h:1083
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
Definition qstyle.h:29
virtual QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
@ SH_DialogButtonBox_ButtonsHaveIcons
Definition qstyle.h:654
@ SH_DialogButtonLayout
Definition qstyle.h:651
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
StandardPixmap
This enum describes the available standard pixmaps.
Definition qstyle.h:714
@ SP_DialogDiscardButton
Definition qstyle.h:762
@ SP_DialogRetryButton
Definition qstyle.h:790
@ SP_DialogNoButton
Definition qstyle.h:764
@ SP_RestoreDefaultsButton
Definition qstyle.h:792
@ SP_DialogCloseButton
Definition qstyle.h:759
@ SP_DialogOpenButton
Definition qstyle.h:757
@ SP_DialogSaveAllButton
Definition qstyle.h:788
@ SP_DialogCancelButton
Definition qstyle.h:755
@ SP_DialogIgnoreButton
Definition qstyle.h:791
@ SP_DialogHelpButton
Definition qstyle.h:756
@ SP_DialogSaveButton
Definition qstyle.h:758
@ SP_DialogNoToAllButton
Definition qstyle.h:787
@ SP_DialogResetButton
Definition qstyle.h:761
@ SP_DialogOkButton
Definition qstyle.h:754
@ SP_DialogAbortButton
Definition qstyle.h:789
@ SP_DialogYesButton
Definition qstyle.h:763
@ SP_DialogApplyButton
Definition qstyle.h:760
@ SP_DialogYesToAllButton
Definition qstyle.h:786
@ SE_PushButtonLayoutItem
Definition qstyle.h:294
The QVBoxLayout class lines up widgets vertically.
Definition qboxlayout.h:91
void setLayoutItemMargins(int left, int top, int right, int bottom)
void getLayoutItemMargins(int *left, int *top, int *right, int *bottom) const
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
void setParent(QWidget *parent)
Sets the parent of the widget to parent, and resets the window flags.
void setStyle(QStyle *)
Sets the widget's GUI style to style.
Definition qwidget.cpp:2637
static void setTabOrder(QWidget *, QWidget *)
Puts the second widget after the first widget in the focus order.
Definition qwidget.cpp:7002
void setFocusProxy(QWidget *)
Sets the widget's focus proxy to widget w.
Definition qwidget.cpp:6372
void hide()
Hides the widget.
Definition qwidget.cpp:8209
void show()
Shows the widget and its child widgets.
Definition qwidget.cpp:7956
virtual void changeEvent(QEvent *)
This event handler can be reimplemented to handle state changes.
Definition qwidget.cpp:9428
bool event(QEvent *event) override
This is the main event handler; it handles event event.
Definition qwidget.cpp:8912
QStyle * style() const
Definition qwidget.cpp:2607
QOpenGLWidget * widget
[1]
QString text
QPushButton * button
[2]
qDeleteAll(list.begin(), list.end())
QSet< QString >::iterator it
Combined button and popup list for selecting options.
@ WA_WState_OwnSizePolicy
Definition qnamespace.h:333
Orientation
Definition qnamespace.h:97
@ Horizontal
Definition qnamespace.h:98
@ Vertical
Definition qnamespace.h:99
#define Q_FALLTHROUGH()
#define Q_UNLIKELY(x)
DBusConnection const char * rule
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define qWarning
Definition qlogging.h:162
GLuint64 key
GLuint GLuint end
GLdouble GLdouble GLdouble GLdouble top
GLdouble GLdouble right
GLint left
GLenum type
GLint GLint bottom
GLuint start
struct _cl_event * event
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLfloat GLfloat p
[1]
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
#define M(_x, _y)
#define sp
#define emit
unsigned int uint
Definition qtypes.h:29
QList< int > list
[14]
QPushButton * pushButton
QObject::connect nullptr
QFileDialog dialog(this)
[1]
QGraphicsItem * item
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent