Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
qquickabstractdialog_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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#ifndef QQUICKABSTRACTDIALOG_P_H
5#define QQUICKABSTRACTDIALOG_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <memory>
19
20#include <QtCore/qobject.h>
21#include <QtGui/qpa/qplatformtheme.h>
22#include <QtGui/qpa/qplatformdialoghelper.h>
23#include <QtQml/qqmlparserstatus.h>
24#include <QtQml/qqmllist.h>
25#include <QtQml/qqml.h>
26#include <QtQuickDialogs2Utils/private/qquickdialogtype_p.h>
27
29
31
32class QWindow;
34
35class Q_QUICKDIALOGS2_PRIVATE_EXPORT QQuickAbstractDialog : public QObject, public QQmlParserStatus
36{
40 Q_PROPERTY(QWindow *parentWindow READ parentWindow WRITE setParentWindow NOTIFY parentWindowChanged FINAL)
41 Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL)
42 Q_PROPERTY(Qt::WindowFlags flags READ flags WRITE setFlags NOTIFY flagsChanged FINAL)
43 Q_PROPERTY(Qt::WindowModality modality READ modality WRITE setModality NOTIFY modalityChanged FINAL)
44 Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL)
45 Q_PROPERTY(StandardCode result READ result WRITE setResult NOTIFY resultChanged FINAL)
46 Q_CLASSINFO("DefaultProperty", "data")
47 Q_MOC_INCLUDE(<QtGui/qwindow.h>)
50
51public:
54
56
58
59 QWindow *parentWindow() const;
60 void setParentWindow(QWindow *window);
61
62 QString title() const;
63 void setTitle(const QString &title);
64
65 Qt::WindowFlags flags() const;
66 void setFlags(Qt::WindowFlags flags);
67
68 Qt::WindowModality modality() const;
69 void setModality(Qt::WindowModality modality);
70
71 bool isVisible() const;
72 void setVisible(bool visible);
73
74 enum StandardCode { Rejected, Accepted };
75 Q_ENUM(StandardCode)
76
77 StandardCode result() const;
78 void setResult(StandardCode result);
79
80public Q_SLOTS:
81 void open();
82 void close();
83 virtual void accept();
84 virtual void reject();
85 virtual void done(StandardCode result);
86
88 void accepted();
89 void rejected();
96
97protected:
98 void classBegin() override;
99 void componentComplete() override;
100
101 bool create();
102 void destroy();
103
104 virtual bool useNativeDialog() const;
105 virtual void onCreate(QPlatformDialogHelper *dialog);
106 virtual void onShow(QPlatformDialogHelper *dialog);
107 virtual void onHide(QPlatformDialogHelper *dialog);
108
109 QWindow *findParentWindow() const;
110
111 bool m_visibleRequested = false;
112 bool m_visible = false;
113 bool m_complete = false;
114 bool m_firstShow = true;
115 StandardCode m_result = Rejected;
116 QWindow *m_parentWindow = nullptr;
118 Qt::WindowFlags m_flags = Qt::Dialog;
122 std::unique_ptr<QPlatformDialogHelper> m_handle;
123};
124
126
128
129#endif // QQUICKABSTRACTDIALOG_P_H
Definition qlist.h:74
\inmodule QtCore
Definition qobject.h:90
The QPlatformDialogHelper class allows for platform-specific customization of dialogs.
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
Definition qqmllist.h:24
The QQmlParserStatus class provides updates on the QML parser state.
virtual void classBegin()=0
Invoked after class creation, but before any properties have been set.
virtual void componentComplete()=0
Invoked after the root component that caused this instantiation has completed construction.
std::unique_ptr< QPlatformDialogHelper > m_handle
QQmlListProperty< QObject > data()
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
WindowModality
@ WindowModal
@ Dialog
Definition qnamespace.h:207
GLuint64 GLenum void * handle
GLenum type
GLbitfield flags
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint64EXT * result
[6]
#define QML_DECLARE_TYPE(TYPE)
Definition qqml.h:19
#define QML_ANONYMOUS
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
QQuickDialogType
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_CLASSINFO(name, value)
#define Q_INTERFACES(x)
#define Q_SLOTS
#define Q_MOC_INCLUDE(...)
#define Q_SIGNALS
file open(QIODevice::ReadOnly)
QString title
[35]
QFileDialog dialog(this)
[1]
edit isVisible()
aWidget window() -> setWindowTitle("New Window Title")
[2]
g setTitle("&User information")
[0]
view create()
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent