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
qquicklabsplatformdialog_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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 QQUICKLABSPLATFORMDIALOG_P_H
5#define QQUICKLABSPLATFORMDIALOG_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 <QtCore/qobject.h>
19#include <QtGui/qpa/qplatformtheme.h>
20#include <QtGui/qpa/qplatformdialoghelper.h>
21#include <QtQml/qqmlparserstatus.h>
22#include <QtQml/qqmllist.h>
23#include <QtQml/qqml.h>
24#include <QtCore/private/qglobal_p.h>
25
27
28class QWindow;
30
32{
35 QML_NAMED_ELEMENT(Dialog)
36 QML_UNCREATABLE("Dialog is an abstract base class")
40 Q_PROPERTY(Qt::WindowFlags flags READ flags WRITE setFlags NOTIFY flagsChanged FINAL)
41 Q_PROPERTY(Qt::WindowModality modality READ modality WRITE setModality NOTIFY modalityChanged FINAL)
43 Q_PROPERTY(int result READ result WRITE setResult NOTIFY resultChanged FINAL)
44 Q_CLASSINFO("DefaultProperty", "data")
45
46public:
49
51
53
54 QWindow *parentWindow() const;
56
57 QString title() const;
58 void setTitle(const QString &title);
59
60 Qt::WindowFlags flags() const;
61 void setFlags(Qt::WindowFlags flags);
62
63 Qt::WindowModality modality() const;
64 void setModality(Qt::WindowModality modality);
65
66 bool isVisible() const;
67 void setVisible(bool visible);
68
71
72 int result() const;
73 void setResult(int result);
74
75public Q_SLOTS:
76 void open();
77 void close();
78 virtual void accept();
79 virtual void reject();
80 virtual void done(int result);
81
83 void accepted();
84 void rejected();
91
92protected:
93 void classBegin() override;
94 void componentComplete() override;
95
96 bool create();
97 void destroy();
98
99 virtual bool useNativeDialog() const;
101 virtual void onShow(QPlatformDialogHelper *dialog);
102 virtual void onHide(QPlatformDialogHelper *dialog);
103
104 QWindow *findParentWindow() const;
105
106private:
107 bool m_visible;
108 bool m_complete;
109 int m_result;
110 QWindow *m_parentWindow;
111 QString m_title;
112 Qt::WindowFlags m_flags;
113 Qt::WindowModality m_modality;
115 QList<QObject *> m_data;
116 QPlatformDialogHelper *m_handle;
117};
118
120{
123 QML_NAMED_ELEMENT(StandardButton)
124 QML_UNCREATABLE("Cannot create an instance of StandardButton")
125};
126
128
129#endif // QQUICKLABSPLATFORMDIALOG_P_H
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
The QPlatformDialogHelper class allows for platform-specific customization of dialogs.
The QPlatformTheme class allows customizing the UI based on themes.
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 reject()
\qmlmethod void Qt.labs.platform::Dialog::reject()
void open()
\qmlmethod void Qt.labs.platform::Dialog::open()
void close()
\qmlmethod void Qt.labs.platform::Dialog::close()
bool isVisible() const
\qmlproperty bool Qt.labs.platform::Dialog::visible
void classBegin() override
Invoked after class creation, but before any properties have been set.
virtual void onShow(QPlatformDialogHelper *dialog)
virtual void onHide(QPlatformDialogHelper *dialog)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void setTitle(const QString &title)
virtual void onCreate(QPlatformDialogHelper *dialog)
virtual void accept()
\qmlmethod void Qt.labs.platform::Dialog::accept()
void setFlags(Qt::WindowFlags flags)
void setModality(Qt::WindowModality modality)
\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
GLuint64 GLenum void * handle
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum type
GLbitfield flags
GLuint64EXT * result
[6]
#define QML_UNCREATABLE(REASON)
#define QML_NAMED_ELEMENT(NAME)
#define QML_FOREIGN(FOREIGN_TYPE)
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_CLASSINFO(name, value)
#define Q_INTERFACES(x)
#define Q_SLOTS
#define Q_GADGET
#define Q_SIGNALS
#define explicit
QFileDialog dialog(this)
[1]
aWidget window() -> setWindowTitle("New Window Title")
[2]