![]() |
Qt 6.x
The Qt SDK
|
#include <qdialogbuttonbox_p.h>
Public Types | |
enum class | RemoveRule { KeepConnections , Disconnect } |
enum class | LayoutRule { DoLayout , SkipLayout } |
enum class | AddRule { Connect , SkipConnect } |
![]() | |
enum | DrawWidgetFlag { DrawAsRoot = 0x01 , DrawPaintOnScreen = 0x02 , DrawRecursive = 0x04 , DrawInvisible = 0x08 , DontSubtractOpaqueChildren = 0x10 , DontDrawOpaqueChildren = 0x20 , DontDrawNativeChildren = 0x40 , DontSetCompositionMode = 0x80 , UseEffectRegionBounds = 0x100 } |
enum | Direction { DirectionNorth = 0x01 , DirectionEast = 0x10 , DirectionSouth = 0x02 , DirectionWest = 0x20 } |
enum class | WindowHandleMode { Direct , Closest , TopLevel } |
enum | CloseMode { CloseNoEvent , CloseWithEvent , CloseWithSpontaneousEvent } |
![]() | |
typedef void(* | StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **) |
using | ConnectionDataPointer = QExplicitlySharedDataPointer< ConnectionData > |
Additional Inherited Members | |
![]() | |
static QWidgetPrivate * | get (QWidget *w) |
static const QWidgetPrivate * | get (const QWidget *w) |
static void | checkRestoredGeometry (const QRect &availableGeometry, QRect *restoredGeometry, int frameHeight) |
static void | adjustFlags (Qt::WindowFlags &flags, QWidget *w=nullptr) |
static QWidget * | parentGraphicsView (const QWidget *widget) |
static QRect | screenGeometry (const QWidget *widget) |
static QRect | availableScreenGeometry (const QWidget *widget) |
static QScreen * | screen (const QWidget *widget, const QPoint &globalPosition, bool hasPosition=true) |
static QRect | screenGeometry (const QWidget *widget, const QPoint &globalPosition, bool hasPosition=true) |
static QRect | availableScreenGeometry (const QWidget *widget, const QPoint &globalPosition, bool hasPosition=true) |
static void | sendComposeStatus (QWidget *w, bool end) |
static void | setWidgetParentHelper (QObject *widgetAsObject, QObject *newParent) |
![]() | |
static bool | removeConnection (Connection *c) |
static QObjectPrivate * | get (QObject *o) |
static const QObjectPrivate * | get (const QObject *o) |
template<typename Func1 , typename Func2 > | |
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) |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot) |
static QMetaObject::Connection | connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static bool | disconnect (const QObject *sender, int signal_index, void **slot) |
static bool | disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot) |
![]() | |
static QWidgetMapper * | mapper = nullptr |
static QWidgetSet * | allWidgets = nullptr |
static int | instanceCounter = 0 |
static int | maxInstances = 0 |
Definition at line 22 of file qdialogbuttonbox_p.h.
|
strong |
Enumerator | |
---|---|
Connect | |
SkipConnect |
Definition at line 35 of file qdialogbuttonbox_p.h.
|
strong |
Enumerator | |
---|---|
DoLayout | |
SkipLayout |
Definition at line 31 of file qdialogbuttonbox_p.h.
|
strong |
Enumerator | |
---|---|
KeepConnections | |
Disconnect |
Definition at line 27 of file qdialogbuttonbox_p.h.
QDialogButtonBoxPrivate::QDialogButtonBoxPrivate | ( | Qt::Orientation | orient | ) |
Definition at line 115 of file qdialogbuttonbox.cpp.
void QDialogButtonBoxPrivate::addButton | ( | QAbstractButton * | button, |
QDialogButtonBox::ButtonRole | role, | ||
LayoutRule | layoutRule = LayoutRule::DoLayout , |
||
AddRule | addRule = AddRule::Connect |
||
) |
Definition at line 369 of file qdialogbuttonbox.cpp.
References QList< T >::append(), button, buttonLists, QAbstractButton::clicked(), QObjectPrivate::connect(), Connect, QObject::destroyed(), DoLayout, handleButtonClicked(), handleButtonDestroyed(), QObject::installEventFilter(), layoutButtons(), SkipConnect, and SkipLayout.
Referenced by createButton(), and handleButtonShowAndHide().
void QDialogButtonBoxPrivate::addButtonsToLayout | ( | const QList< QAbstractButton * > & | buttonList, |
bool | reverse | ||
) |
Definition at line 155 of file qdialogbuttonbox.cpp.
References QBoxLayout::addWidget(), QList< T >::at(), button, buttonLayout, i, QWidget::show(), and QList< T >::size().
Referenced by layoutButtons().
QList< QAbstractButton * > QDialogButtonBoxPrivate::allButtons | ( | ) | const |
Definition at line 660 of file qdialogbuttonbox.cpp.
References hiddenButtons, QHash< Key, T >::keys(), and visibleButtons().
QDialogButtonBox::ButtonRole QDialogButtonBoxPrivate::buttonRole | ( | QAbstractButton * | button | ) | const |
QPushButton * QDialogButtonBoxPrivate::createButton | ( | QDialogButtonBox::StandardButton | button, |
LayoutRule | layoutRule = LayoutRule::DoLayout |
||
) |
Definition at line 284 of file qdialogbuttonbox.cpp.
References QDialogButtonBox::Abort, addButton(), QDialogButtonBox::Apply, button, QPlatformDialogHelper::buttonRole(), QDialogButtonBox::Cancel, QDialogButtonBox::Close, QDialogButtonBox::Discard, QDialogButtonBox::Help, icon, QDialogButtonBox::Ignore, QHash< Key, T >::insert(), QPlatformDialogHelper::InvalidRole, QKeySequence::isEmpty(), QDialogButtonBox::No, QDialogButtonBox::NoButton, QDialogButtonBox::NoToAll, QDialogButtonBox::Ok, QDialogButtonBox::Open, QGuiApplicationPrivate::platformTheme(), Q_UNLIKELY, qWarning, QDialogButtonBox::Reset, QDialogButtonBox::RestoreDefaults, QDialogButtonBox::Retry, QDialogButtonBox::Save, QDialogButtonBox::SaveAll, QAbstractButton::setIcon(), QAbstractButton::setShortcut(), QWidget::setStyle(), QStyle::SH_DialogButtonBox_ButtonsHaveIcons, QStyle::SP_DialogAbortButton, QStyle::SP_DialogApplyButton, QStyle::SP_DialogCancelButton, QStyle::SP_DialogCloseButton, QStyle::SP_DialogDiscardButton, QStyle::SP_DialogHelpButton, QStyle::SP_DialogIgnoreButton, QStyle::SP_DialogNoButton, QStyle::SP_DialogNoToAllButton, QStyle::SP_DialogOkButton, QStyle::SP_DialogOpenButton, QStyle::SP_DialogResetButton, QStyle::SP_DialogRetryButton, QStyle::SP_DialogSaveAllButton, QStyle::SP_DialogSaveButton, QStyle::SP_DialogYesButton, QStyle::SP_DialogYesToAllButton, QStyle::SP_RestoreDefaultsButton, standardButtonHash, QStyle::standardIcon(), QApplication::style(), QStyle::styleHint(), QDialogButtonBox::Yes, and QDialogButtonBox::YesToAll.
Referenced by createStandardButtons().
void QDialogButtonBoxPrivate::createStandardButtons | ( | QDialogButtonBox::StandardButtons | buttons | ) |
Definition at line 395 of file qdialogbuttonbox.cpp.
References createButton(), QDialogButtonBox::FirstButton, i, QDialogButtonBox::LastButton, layoutButtons(), and SkipLayout.
void QDialogButtonBoxPrivate::disconnectAll | ( | ) |
Definition at line 1010 of file qdialogbuttonbox.cpp.
References button, and QObject::disconnect().
void QDialogButtonBoxPrivate::ensureFirstAcceptIsDefault | ( | ) |
Definition at line 976 of file qdialogbuttonbox.cpp.
References QDialogButtonBox::AcceptRole, QList< T >::at(), buttonLists, dialog, QObject::findChildren(), QPushButton::isDefault(), QList< T >::isEmpty(), nullptr, QObjectData::parent, pushButton, Q_ASSERT, and QPushButton::setDefault().
Referenced by handleButtonShowAndHide().
void QDialogButtonBoxPrivate::handleButtonClicked | ( | ) |
Definition at line 832 of file qdialogbuttonbox.cpp.
References QPlatformDialogHelper::AcceptRole, button, buttonRole(), emit, QPlatformDialogHelper::HelpRole, QPlatformDialogHelper::NoRole, QPlatformDialogHelper::RejectRole, and QPlatformDialogHelper::YesRole.
Referenced by addButton(), and removeButton().
void QDialogButtonBoxPrivate::handleButtonDestroyed | ( | ) |
Definition at line 866 of file qdialogbuttonbox.cpp.
References KeepConnections, removeButton(), and QObject::sender().
Referenced by addButton(), QDialogButtonBox::clear(), and removeButton().
bool QDialogButtonBoxPrivate::handleButtonShowAndHide | ( | QAbstractButton * | button, |
QEvent * | event | ||
) |
Definition at line 891 of file qdialogbuttonbox.cpp.
References QDialogButtonBox::AcceptRole, addButton(), button, QHash< Key, T >::contains(), DoLayout, ensureFirstAcceptIsDefault(), hiddenButtons, QEvent::HideToParent, QHash< Key, T >::insert(), QDialogButtonBox::InvalidRole, KeepConnections, layoutButtons(), removeButton(), QEvent::ShowToParent, SkipConnect, and QHash< Key, T >::take().
void QDialogButtonBoxPrivate::initLayout | ( | ) |
Definition at line 120 of file qdialogbuttonbox.cpp.
References QSizePolicy::ButtonBox, buttonLayout, QSizePolicy::Expanding, QSizePolicy::Fixed, QWidgetPrivate::getLayoutItemMargins(), Qt::Horizontal, layoutPolicy, orientation, QStyle::SE_PushButtonLayoutItem, QLayout::setContentsMargins(), QWidgetPrivate::setLayoutItemMargins(), QStyle::SH_DialogButtonLayout, sp, Qt::Vertical, and Qt::WA_WState_OwnSizePolicy.
Referenced by resetLayout().
void QDialogButtonBoxPrivate::layoutButtons | ( | ) |
Definition at line 169 of file qdialogbuttonbox.cpp.
References QPlatformDialogHelper::AcceptRole, QPlatformDialogHelper::ActionRole, addButtonsToLayout(), QBoxLayout::addSpacing(), QBoxLayout::addStretch(), QBoxLayout::addWidget(), QPlatformDialogHelper::AlternateRole, QPlatformDialogHelper::ApplyRole, button, QPlatformDialogHelper::buttonLayout(), buttonLayout, buttonLists, byPassEventFilter, center, QBoxLayout::count(), QPlatformDialogHelper::DestructiveRole, QPlatformDialogHelper::EOL, QList< T >::first(), QPlatformDialogHelper::HelpRole, QWidget::hide(), i, QList< T >::isEmpty(), item, QBoxLayout::itemAt(), layoutPolicy, list, M, QDialogButtonBox::MacLayout, QList< T >::mid(), QPlatformDialogHelper::NoRole, orientation, QPlatformDialogHelper::RejectRole, QPlatformDialogHelper::ResetRole, QPlatformDialogHelper::Reverse, QWidget::setFocusProxy(), QWidget::setTabOrder(), QWidget::show(), QList< T >::size(), QPlatformDialogHelper::Stretch, QBoxLayout::takeAt(), widget, and QPlatformDialogHelper::YesRole.
Referenced by addButton(), createStandardButtons(), handleButtonShowAndHide(), and resetLayout().
void QDialogButtonBoxPrivate::removeButton | ( | QAbstractButton * | button, |
RemoveRule | rule | ||
) |
Definition at line 695 of file qdialogbuttonbox.cpp.
References button, buttonLists, QAbstractButton::clicked(), QObject::destroyed(), QObjectPrivate::disconnect(), Disconnect, handleButtonClicked(), handleButtonDestroyed(), hiddenButtons, i, KeepConnections, QDialogButtonBox::NRoles, QHash< Key, T >::remove(), QObject::removeEventFilter(), rule, QWidget::setParent(), and standardButtonHash.
Referenced by handleButtonDestroyed(), and handleButtonShowAndHide().
void QDialogButtonBoxPrivate::resetLayout | ( | ) |
Definition at line 149 of file qdialogbuttonbox.cpp.
References initLayout(), and layoutButtons().
void QDialogButtonBoxPrivate::retranslateStrings | ( | ) |
Definition at line 406 of file qdialogbuttonbox.cpp.
References QString::isEmpty(), QGuiApplicationPrivate::platformTheme(), standardButtonHash, QPlatformTheme::standardButtonText(), and text.
QList< QAbstractButton * > QDialogButtonBoxPrivate::visibleButtons | ( | ) | const |
Definition at line 649 of file qdialogbuttonbox.cpp.
References QList< T >::append(), QList< T >::at(), buttonLists, i, j, list, QDialogButtonBox::NRoles, and QList< T >::size().
Referenced by allButtons().
QBoxLayout* QDialogButtonBoxPrivate::buttonLayout |
Definition at line 48 of file qdialogbuttonbox_p.h.
Referenced by addButtonsToLayout(), initLayout(), and layoutButtons().
QList<QAbstractButton *> QDialogButtonBoxPrivate::buttonLists[QDialogButtonBox::NRoles] |
Definition at line 42 of file qdialogbuttonbox_p.h.
Referenced by addButton(), ensureFirstAcceptIsDefault(), layoutButtons(), removeButton(), and visibleButtons().
bool QDialogButtonBoxPrivate::byPassEventFilter = false |
Definition at line 50 of file qdialogbuttonbox_p.h.
Referenced by layoutButtons().
bool QDialogButtonBoxPrivate::center |
Definition at line 49 of file qdialogbuttonbox_p.h.
Referenced by layoutButtons().
QHash<QAbstractButton *, QDialogButtonBox::ButtonRole> QDialogButtonBoxPrivate::hiddenButtons |
Definition at line 44 of file qdialogbuttonbox_p.h.
Referenced by allButtons(), handleButtonShowAndHide(), and removeButton().
QDialogButtonBox::ButtonLayout QDialogButtonBoxPrivate::layoutPolicy |
Definition at line 47 of file qdialogbuttonbox_p.h.
Referenced by initLayout(), and layoutButtons().
Qt::Orientation QDialogButtonBoxPrivate::orientation |
Definition at line 46 of file qdialogbuttonbox_p.h.
Referenced by initLayout(), and layoutButtons().
QHash<QPushButton *, QDialogButtonBox::StandardButton> QDialogButtonBoxPrivate::standardButtonHash |
Definition at line 43 of file qdialogbuttonbox_p.h.
Referenced by createButton(), removeButton(), and retranslateStrings().