Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
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_EXPORT QQuickAbstractDialog : public QObject, public QQmlParserStatus
36{
40 Q_PROPERTY(QWindow *parentWindow READ parentWindow WRITE setParentWindow NOTIFY parentWindowChanged RESET resetParentWindow 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(int 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 void resetParentWindow();
62
63 QString title() const;
64 void setTitle(const QString &title);
65
66 Qt::WindowFlags flags() const;
67 void setFlags(Qt::WindowFlags flags);
68
69 Qt::WindowModality modality() const;
70 void setModality(Qt::WindowModality modality);
71
72 bool isVisible() const;
73 void setVisible(bool visible);
74
75 enum StandardCode { Rejected, Accepted };
76 Q_ENUM(StandardCode)
77
78 int result() const;
79 void setResult(int result);
80
81public Q_SLOTS:
82 void open();
83 void close();
84 virtual void accept();
85 virtual void reject();
86 virtual void done(int result);
87
89 void accepted();
90 void rejected();
97
98protected:
99 void classBegin() override;
100 void componentComplete() override;
101
102 bool create();
103 void destroy();
104
105 virtual bool useNativeDialog() const;
106 virtual void onCreate(QPlatformDialogHelper *dialog);
107 virtual void onShow(QPlatformDialogHelper *dialog);
108 virtual void onHide(QPlatformDialogHelper *dialog);
109 virtual int dialogCode() const;
110
111 QQuickItem *findParentItem() const;
112 QWindow *windowForOpen() const;
113 void deferredOpen(QWindow *window);
114
115 int m_result = Rejected;
116 QWindow *m_parentWindow = nullptr;
118 Qt::WindowFlags m_flags = Qt::Dialog;
121 QList<QObject *> m_data;
122 std::unique_ptr<QPlatformDialogHelper> m_handle;
123 bool m_visibleRequested = false;
124 bool m_visible = false;
125 bool m_complete = false;
126 bool m_parentWindowExplicitlySet = false;
127 bool m_firstShow = true;
128};
129
131
132#endif // QQUICKABSTRACTDIALOG_P_H
\inmodule QtCore
Definition qobject.h:103
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.
std::unique_ptr< QPlatformDialogHelper > m_handle
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtGui
Definition qwindow.h:63
Combined button and popup list for selecting options.
Definition qcompare.h:63
WindowModality
@ WindowModal
@ Dialog
Definition qnamespace.h:208
GLuint64 GLenum void * handle
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum type
GLbitfield flags
GLfloat GLfloat GLfloat GLfloat h
GLuint64EXT * result
[6]
#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
#define explicit
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()