40 #include <QtCore/qhash.h>
41 #include <QtWidgets/qpushbutton.h>
42 #include <QtWidgets/qstyle.h>
43 #include <QtWidgets/qlayout.h>
44 #include <QtWidgets/qdialog.h>
45 #include <QtWidgets/qapplication.h>
46 #include <private/qwidget_p.h>
47 #include <private/qguiapplication_p.h>
48 #include <QtGui/qpa/qplatformdialoghelper.h>
49 #include <QtGui/qpa/qplatformtheme.h>
50 #include <QtGui/qaction.h>
192 if (createNewLayout) {
209 q->setSizePolicy(
sp);
224 int start = reverse ? buttonList.
count() - 1 : 0;
225 int end = reverse ? -1 : buttonList.
count();
226 int step = reverse ? -1 : 1;
238 const int MacGap = 36 - 8;
249 static const int M = 5;
253 bool hasModalButton =
false;
254 for (
int i = 0;
i <
M; ++
i) {
256 hasModalButton =
true;
291 if (acceptRoleList.
size() > 1)
423 qWarning(
"QDialogButtonBox::createButton: Invalid ButtonRole, button not added");
426 #if QT_CONFIG(shortcut)
428 if (!standardShortcut.
isEmpty())
487 d_func()->initLayout();
513 d_func()->createStandardButtons(
buttons);
649 return d_func()->orientation;
672 d->standardButtonHash.clear();
675 while (
list.count()) {
694 for (
int j = 0;
j <
list.count(); ++
j)
711 for (
int j = 0;
j <
list.count(); ++
j) {
735 for (
int j = 0;
j <
list.count(); ++
j) {
738 if (!
d->internalRemove) {
746 if (!
d->internalRemove)
765 qWarning(
"QDialogButtonBox::addButton: Invalid ButtonRole, button not added");
784 qWarning(
"QDialogButtonBox::addButton: Invalid ButtonRole, button not added");
802 return d->createButton(
button);
818 d->standardButtonHash.clear();
828 while (
it !=
d->standardButtonHash.constEnd()) {
844 return d->standardButtonHash.key(which);
885 emit q->helpRequested();
936 switch (
event->type()) {
938 if (!
d->standardButtonHash.empty()) {
942 it.key()->setStyle(newStyle);
965 QPushButton *firstAcceptButton = acceptRoleList.
isEmpty() ? 0 : qobject_cast<QPushButton *>(acceptRoleList.
at(0));
966 bool hasDefault =
false;
969 while (
p && !
p->isWindow()) {
971 if ((
dialog = qobject_cast<QDialog *>(
p)))
975 const auto pbs = (
dialog ?
dialog :
this)->findChildren<QPushButton *>();
982 if (!hasDefault && firstAcceptButton)
985 d->retranslateStrings();
992 #include "moc_qdialogbuttonbox.cpp"
small capitals from c petite p scientific i
[1]
The QBoxLayout class lines up child widgets horizontally or vertically.
int count() const override
void addWidget(QWidget *, int stretch=0, Qt::Alignment alignment=Qt::Alignment())
QLayoutItem * takeAt(int) override
void addSpacing(int size)
void addStretch(int stretch=0)
QLayoutItem * itemAt(int) const override
The QEvent class is the base class of all event classes. Event objects contain event parameters.
static QPlatformTheme * platformTheme()
The QHBoxLayout class lines up widgets horizontally.
The QHash::const_iterator class provides an STL-style const iterator for QHash.
iterator insert(const Key &key, const T &value)
The QKeySequence class encapsulates a key sequence as used by shortcuts.
void setContentsMargins(int left, int top, int right, int bottom)
The QLayoutItem class provides an abstract item that a QLayout manipulates.
qsizetype size() const noexcept
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
qsizetype count() const noexcept
QList< T > mid(qsizetype pos, qsizetype len=-1) const
void append(parameter_type t)
The QObject class is the base class of all Qt objects.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
void destroyed(QObject *=nullptr)
The QPointer class is a template class that provides guarded pointers to QObject.
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
The QString class provides a Unicode character string.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
@ SH_DialogButtonBox_ButtonsHaveIcons
@ SP_RestoreDefaultsButton
@ SP_DialogYesToAllButton
@ SE_PushButtonLayoutItem
The QVBoxLayout class lines up widgets vertically.
qDeleteAll(list.begin(), list.end())
typename C::iterator iterator
@ WA_WState_OwnSizePolicy
QTextStream & center(QTextStream &stream)
GLdouble GLdouble GLdouble GLdouble top
GLdouble GLdouble GLdouble GLdouble q
QFileDialog dialog(this)
[1]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent