40 #include <QtWidgets/qtwidgetsglobal.h>
41 #if QT_CONFIG(colordialog)
44 #if QT_CONFIG(fontdialog)
47 #if QT_CONFIG(filedialog)
54 #if QT_CONFIG(sizegrip)
57 #if QT_CONFIG(whatsthis)
64 #if QT_CONFIG(messagebox)
67 #if QT_CONFIG(errormessage)
70 #include <qpa/qplatformtheme.h>
71 #include "private/qdialog_p.h"
72 #include "private/qguiapplication_p.h"
73 #ifndef QT_NO_ACCESSIBILITY
81 #if QT_CONFIG(filedialog)
82 if (qobject_cast<const QFileDialog *>(
dialog))
85 #if QT_CONFIG(colordialog)
86 if (qobject_cast<const QColorDialog *>(
dialog))
89 #if QT_CONFIG(fontdialog)
90 if (qobject_cast<const QFontDialog *>(
dialog))
93 #if QT_CONFIG(messagebox)
94 if (qobject_cast<const QMessageBox *>(
dialog))
97 #if QT_CONFIG(errormessage)
98 if (qobject_cast<const QErrorMessage *>(
dialog))
101 #if !QT_CONFIG(filedialog) && !QT_CONFIG(colordialog) && !QT_CONFIG(fontdialog) && \
102 !QT_CONFIG(messagebox) && !QT_CONFIG(errormessage)
110 delete m_platformHelper;
118 m_platformHelperCreated =
true;
125 if (m_platformHelper) {
128 ncThis->initHelper(m_platformHelper);
132 return m_platformHelper;
155 q->setResult(resultCode);
157 if (!
data.is_closing) {
161 struct CloseEventEater :
QObject
172 q->installEventFilter(&closeEventEater);
201 emit q->finished(resultCode);
208 return parent->windowHandle();
209 else if (
q->windowHandle())
210 return q->windowHandle()->transientParent();
219 helperPrepareShow(
helper);
231 return helper->styleHint(hint);
237 delete m_platformHelper;
238 m_platformHelper =
nullptr;
239 m_platformHelperCreated =
false;
455 #if QT_CONFIG(pushbutton)
459 bool hasMain =
false;
461 for (
int i=0;
i<
list.size(); ++
i) {
471 mainDef->setDefault(
true);
492 void QDialogPrivate::hideDefault()
496 for (
int i=0;
i<
list.size(); ++
i) {
497 list.at(
i)->setDefault(
false);
561 d->resetModalityTo = modality;
600 qWarning(
"QDialog::exec: Recursive call detected");
607 d->resetModalitySetByOpen();
616 if (
d->nativeDialogInUse) {
617 d->platformHelper()->exec();
620 d->eventLoop = &eventLoop;
625 d->eventLoop =
nullptr;
630 if (
d->nativeDialogInUse)
693 #ifndef QT_NO_CONTEXTMENU
697 #if !QT_CONFIG(whatsthis) || !QT_CONFIG(menu)
707 w =
w->isWindow() ?
nullptr :
w->parentWidget();
711 if (
p.data()->exec(
e->globalPos()) == wt) {
713 w->mapToGlobal(
w->rect().center()));
725 #ifndef QT_NO_SHORTCUT
735 #if QT_CONFIG(pushbutton)
739 for (
int i=0;
i<
list.size(); ++
i) {
762 #if QT_CONFIG(whatsthis)
797 if (dontBlockWindows) {
826 #if QT_CONFIG(pushbutton)
831 if (
first !=
d->mainDef && qobject_cast<QPushButton*>(
first))
832 d->mainDef->setFocus();
836 while ((
w =
w->nextInFocusChain()) != fw) {
851 #ifndef QT_NO_ACCESSIBILITY
860 #ifndef QT_NO_ACCESSIBILITY
870 d->eventLoop->exit();
873 if (dontBlockWindows) {
878 #if QT_CONFIG(pushbutton)
907 int extraw = 0, extrah = 0;
908 const QWindow *parentWindow =
nullptr;
912 parentWindow =
d->transientParentWindow();
918 else if (parentWindow)
919 scrn = parentWindow->screen();
928 for (
int i = 0; (extraw == 0 || extrah == 0) &&
i <
list.size(); ++
i) {
931 int framew = current->
geometry().
x() - current->
x();
932 int frameh = current->
geometry().
y() - current->
y();
934 extraw = qMax(extraw, framew);
935 extrah = qMax(extrah, frameh);
941 if (extraw == 0 || extrah == 0 || extraw >= 10 || extrah >= 40) {
950 if (
w->windowHandle() && qvariant_cast<WId>(
w->windowHandle()->property(
"_q_embedded_native_parent_handle")))
953 pp =
w->mapToGlobal(
QPoint(0,0));
955 pp.
y() +
w->height()/ 2);
956 }
else if (parentWindow) {
973 if (
p.x() < desk.
x())
978 if (
p.y() < desk.
y())
1046 #if QT_CONFIG(sizegrip)
1048 return !!
d->resizer;
1057 #if !QT_CONFIG(sizegrip)
1061 #if QT_CONFIG(sizegrip)
1070 d->resizer->resize(
d->resizer->sizeHint());
1072 d->resizer->move(
rect().bottomLeft() -
d->resizer->rect().bottomLeft());
1074 d->resizer->move(
rect().bottomRight() -
d->resizer->rect().bottomRight());
1075 d->resizer->raise();
1079 d->resizer =
nullptr;
1090 #if QT_CONFIG(sizegrip)
1094 d->resizer->move(
rect().bottomLeft() -
d->resizer->rect().bottomLeft());
1096 d->resizer->move(
rect().bottomRight() -
d->resizer->rect().bottomRight());
1097 d->resizer->raise();
1145 #include "moc_qdialog.cpp"
small capitals from c petite p scientific i
[1]
The QAccessibleEvent class is the base class for accessibility notifications.
static void updateAccessibility(QAccessibleEvent *event)
The QAction class provides an abstraction for user commands that can be added to different user inter...
static QWidgetList topLevelWidgets()
The QCloseEvent class contains parameters that describe a close event.
static bool sendEvent(QObject *receiver, QEvent *event)
static void setPos(int x, int y)
The QDialog class is the base class of dialog windows.
void closeEvent(QCloseEvent *) override
QSize sizeHint() const override
bool isSizeGripEnabled() const
bool eventFilter(QObject *, QEvent *) override
void setSizeGripEnabled(bool)
void keyPressEvent(QKeyEvent *) override
QSize minimumSizeHint() const override
void setModal(bool modal)
void resizeEvent(QResizeEvent *) override
void showEvent(QShowEvent *) override
void contextMenuEvent(QContextMenuEvent *) override
QDialog(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
void adjustPosition(QWidget *)
void setVisible(bool visible) override
bool modal
whether show() should pop up the dialog as modal or modeless
bool setNativeDialogVisible(bool visible)
QPlatformDialogHelper * platformHelper() const
void deletePlatformHelper()
virtual bool canBeNativeDialog() const
void finalize(int resultCode, int dialogCode)
QVariant styleHint(QPlatformDialogHelper::StyleHint hint) const
void resetModalitySetByOpen()
QWindow * transientParentWindow() const
The QEvent class is the base class of all event classes. Event objects contain event parameters.
The QEventLoop class provides a means of entering and leaving an event loop.
int exec(ProcessEventsFlags flags=AllEvents)
The QFocusEvent class contains event parameters for widget focus events. \inmodule QtGui.
QScreen * primaryScreen
the primary (or default) screen of the application.
static QScreen * screenAt(const QPoint &point)
static QPlatformTheme * platformTheme()
The QHelpEvent class provides an event that is used to request helpful information about a particular...
The QKeyEvent class describes a key event.
The QObject class is the base class of all Qt objects.
Q_INVOKABLE QObject(QObject *parent=nullptr)
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
virtual bool eventFilter(QObject *watched, QEvent *event)
The QPoint class defines a point in the plane using integer precision.
constexpr int x() const noexcept
constexpr int y() const noexcept
The QPointer class is a template class that provides guarded pointers to QObject.
The QRect class defines a rectangle in the plane using integer precision.
constexpr int height() const noexcept
bool contains(const QRect &r, bool proper=false) const noexcept
constexpr int x() const noexcept
constexpr int width() const noexcept
constexpr int y() const noexcept
The QResizeEvent class contains event parameters for resize events. \inmodule QtGui.
The QScreen class is used to query screen properties. \inmodule QtGui.
QRect availableGeometry
the screen's available geometry in pixels
The QShowEvent class provides an event that is sent when a widget is shown.
The QSizeGrip class provides a resize handle for resizing top-level windows.
The QSize class defines the size of a two-dimensional object using integer point precision.
constexpr int height() const noexcept
The QVariant class acts like a union for the most common Qt data types.
static void leaveWhatsThisMode()
static bool inWhatsThisMode()
The QWindow class represents a window in the underlying windowing system.
int width
the width of the window's geometry
int height
the height of the window's geometry
@ WA_WState_ExplicitShowHide
@ WA_ShowWithoutActivating
GLfloat GLfloat GLfloat w
[0]
GLint GLsizei GLsizei height
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLdouble GLdouble GLdouble GLdouble q
QFileDialog dialog(this)
[1]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent