4#include <QtWidgets/qtwidgetsglobal.h>
5#if QT_CONFIG(colordialog)
8#if QT_CONFIG(fontdialog)
11#if QT_CONFIG(filedialog)
18#if QT_CONFIG(sizegrip)
21#if QT_CONFIG(whatsthis)
28#if QT_CONFIG(messagebox)
31#if QT_CONFIG(errormessage)
34#include <qpa/qplatformtheme.h>
35#include "private/qdialog_p.h"
36#include "private/qguiapplication_p.h"
37#if QT_CONFIG(accessibility)
45#if QT_CONFIG(filedialog)
46 if (qobject_cast<const QFileDialog *>(
dialog))
49#if QT_CONFIG(colordialog)
50 if (qobject_cast<const QColorDialog *>(
dialog))
53#if QT_CONFIG(fontdialog)
54 if (qobject_cast<const QFontDialog *>(
dialog))
57#if QT_CONFIG(messagebox)
58 if (qobject_cast<const QMessageBox *>(
dialog))
61#if QT_CONFIG(errormessage)
62 if (qobject_cast<const QErrorMessage *>(
dialog))
65#if !QT_CONFIG(filedialog) && !QT_CONFIG(colordialog) && !QT_CONFIG(fontdialog) && \
66 !QT_CONFIG(messagebox) && !QT_CONFIG(errormessage)
74 delete m_platformHelper;
82 m_platformHelperCreated =
true;
89 if (m_platformHelper) {
96 return m_platformHelper;
122 q->setResult(resultCode);
124 if (!
data.is_closing) {
128 struct CloseEventEater :
QObject
139 q->installEventFilter(&closeEventEater);
156 return parent->windowHandle();
157 else if (
q->windowHandle())
158 return q->windowHandle()->transientParent();
179 return helper->styleHint(
hint);
364 f | ((
f &
Qt::WindowType_Mask) == 0 ?
Qt::Dialog :
Qt::WindowType(0)))
399#if QT_CONFIG(pushbutton)
403 bool hasMain =
false;
415 mainDef->setDefault(
true);
436void QDialogPrivate::hideDefault()
505 d->resetModalityTo = modality;
544 qWarning(
"QDialog::exec: Recursive call detected");
551 d->resetModalitySetByOpen();
560 if (
d->nativeDialogInUse) {
561 d->platformHelper()->exec();
564 d->eventLoop = &eventLoop;
569 d->eventLoop =
nullptr;
574 if (
d->nativeDialogInUse)
608 int dialogCode =
d->dialogCode();
650#ifndef QT_NO_CONTEXTMENU
654#if !QT_CONFIG(whatsthis) || !QT_CONFIG(menu)
664 w =
w->isWindow() ?
nullptr :
w->parentWidget();
668 if (
p.data()->exec(
e->globalPos()) == wt) {
670 w->mapToGlobal(
w->rect().center()));
682#ifndef QT_NO_SHORTCUT
692#if QT_CONFIG(pushbutton)
719#if QT_CONFIG(whatsthis)
760 if (dontBlockWindows) {
761 oldModality =
q->windowModality();
770 q->QWidget::setVisible(visible);
789#if QT_CONFIG(pushbutton)
794 if (
first != mainDef && qobject_cast<QPushButton*>(
first))
797 if (!mainDef &&
q->isWindow()) {
799 while ((
w =
w->nextInFocusChain()) != fw) {
814#if QT_CONFIG(accessibility)
815 QAccessibleEvent
event(
q, QAccessible::DialogStart);
816 QAccessible::updateAccessibility(&
event);
823#if QT_CONFIG(accessibility)
824 if (
q->isVisible()) {
825 QAccessibleEvent
event(
q, QAccessible::DialogEnd);
826 QAccessible::updateAccessibility(&
event);
831 q->QWidget::setVisible(visible);
836 if (dontBlockWindows) {
837 q->setWindowModality(oldModality);
841#if QT_CONFIG(pushbutton)
843 if (mainDef &&
q->isActiveWindow()
870 int extraw = 0, extrah = 0;
871 const QWindow *parentWindow =
nullptr;
875 parentWindow =
d->transientParentWindow();
881 else if (parentWindow)
882 scrn = parentWindow->screen();
891 for (
int i = 0; (extraw == 0 || extrah == 0) &&
i <
list.
size(); ++
i) {
894 int framew = current->
geometry().
x() - current->
x();
895 int frameh = current->
geometry().
y() - current->
y();
897 extraw =
qMax(extraw, framew);
898 extrah =
qMax(extrah, frameh);
904 if (extraw == 0 || extrah == 0 || extraw >= 10 || extrah >= 40) {
913 if (
w->windowHandle() && qvariant_cast<WId>(
w->windowHandle()->property(
"_q_embedded_native_parent_handle")))
916 pp =
w->mapToGlobal(
QPoint(0,0));
918 pp.
y() +
w->height()/ 2);
919 }
else if (parentWindow) {
936 if (
p.x() < desk.
x())
941 if (
p.y() < desk.
y())
1009#if QT_CONFIG(sizegrip)
1011 return !!
d->resizer;
1020#if !QT_CONFIG(sizegrip)
1024#if QT_CONFIG(sizegrip)
1033 d->resizer->resize(
d->resizer->sizeHint());
1035 d->resizer->move(
rect().bottomLeft() -
d->resizer->rect().bottomLeft());
1037 d->resizer->move(
rect().bottomRight() -
d->resizer->rect().bottomRight());
1038 d->resizer->raise();
1042 d->resizer =
nullptr;
1053#if QT_CONFIG(sizegrip)
1057 d->resizer->move(
rect().bottomLeft() -
d->resizer->rect().bottomLeft());
1059 d->resizer->move(
rect().bottomRight() -
d->resizer->rect().bottomRight());
1060 d->resizer->raise();
1108#include "moc_qdialog.cpp"
The QAction class provides an abstraction for user commands that can be added to different user inter...
QVariant data() const
Returns the user data as set in QAction::setData.
static QWidgetList topLevelWidgets()
Returns a list of the top-level widgets (windows) in the application.
The QCloseEvent class contains parameters that describe a close event.
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
static bool testAttribute(Qt::ApplicationAttribute attribute)
Returns true if attribute attribute is set; otherwise returns false.
static void setPos(int x, int y)
Moves the cursor (hot spot) of the primary screen to the global screen position (x,...
static QPoint pos()
Returns the position of the cursor (hot spot) of the primary screen in global screen coordinates.
bool setNativeDialogVisible(bool visible)
virtual void setVisible(bool visible)
virtual void initHelper(QPlatformDialogHelper *)
QPlatformDialogHelper * platformHelper() const
virtual bool canBeNativeDialog() const
QVariant styleHint(QPlatformDialogHelper::StyleHint hint) const
void resetModalitySetByOpen()
QPointer< QEventLoop > eventLoop
virtual void helperPrepareShow(QPlatformDialogHelper *)
QWindow * transientParentWindow() const
The QDialog class is the base class of dialog windows.
void closeEvent(QCloseEvent *) override
\reimp
QSize sizeHint() const override
\reimp
bool isSizeGripEnabled() const
void finished(int result)
bool eventFilter(QObject *, QEvent *) override
\reimp
void setSizeGripEnabled(bool)
virtual void reject()
Hides the modal dialog and sets the result code to Rejected.
void setResult(int r)
Sets the modal dialog's result code to i.
~QDialog()
Destroys the QDialog, deleting all its children.
void keyPressEvent(QKeyEvent *) override
\reimp
virtual int exec()
Shows the dialog as a \l{QDialog::Modal Dialogs}{modal dialog}, blocking until the user closes it.
QSize minimumSizeHint() const override
\reimp
int result() const
In general returns the modal dialog's result code, Accepted or Rejected.
DialogCode
The value returned by a modal dialog.
void setModal(bool modal)
void resizeEvent(QResizeEvent *) override
\reimp
void showEvent(QShowEvent *) override
\reimp
void contextMenuEvent(QContextMenuEvent *) override
\reimp
QDialog(QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
Constructs a dialog with parent parent.
virtual void done(int)
Closes the dialog and sets its result code to r.
void adjustPosition(QWidget *)
bool modal
whether show() should pop up the dialog as modal or modeless
virtual void accept()
Hides the modal dialog and sets the result code to Accepted.
int exec(ProcessEventsFlags flags=AllEvents)
Enters the main event loop and waits until exit() is called.
void exit(int returnCode=0)
Tells the event loop to exit with a return code.
The QFocusEvent class contains event parameters for widget focus events.
static QPlatformTheme * platformTheme()
QScreen * primaryScreen
the primary (or default) screen of the application.
static QScreen * screenAt(const QPoint &point)
Returns the screen at point, or \nullptr if outside of any screen.
The QHelpEvent class provides an event that is used to request helpful information about a particular...
The QKeyEvent class describes a key event.
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
Q_INVOKABLE QObject(QObject *parent=nullptr)
Constructs an object with parent object parent.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
virtual bool eventFilter(QObject *watched, QEvent *event)
Filters events if this object has been installed as an event filter for the watched object.
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
bool isNull() const
Returns true if the referenced object has been destroyed or if there is no referenced object; otherwi...
\inmodule QtCore\reentrant
constexpr int height() const noexcept
Returns the height of the rectangle.
bool contains(const QRect &r, bool proper=false) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
The QResizeEvent class contains event parameters for resize events.
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.
constexpr int height() const noexcept
Returns the height.
bool toBool() const
Returns the variant as a bool if the variant has userType() Bool.
static void leaveWhatsThisMode()
If the user interface is in "What's This?" mode, this function switches back to normal mode; otherwis...
static bool inWhatsThisMode()
Returns true if the user interface is in "What's This?" mode; otherwise returns false.
int width
the width of the window's geometry
int height
the height of the window's geometry
Combined button and popup list for selecting options.
@ WA_WState_ExplicitShowHide
@ WA_ShowWithoutActivating
@ AA_DontUseNativeDialogs
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
static QT_BEGIN_NAMESPACE int themeDialogType(const QDialog *dialog)
constexpr const T & qMax(const T &a, const T &b)
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
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
QFileDialog dialog(this)
[1]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent