7#include <QtCore/qloggingcategory.h>
8#include <QtGui/private/qguiapplication_p.h>
9#include <QtQuick/qquickitem.h>
10#include <QtQuick/qquickwindow.h>
12#include "widgets/qwidgetplatform_p.h"
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
36
37
38
39
40
41
42
43
44
47
48
49
50
51
52
53
54
55
57Q_STATIC_LOGGING_CATEGORY(qtLabsPlatformDialogs,
"qt.labs.platform.dialogs")
59QQuickLabsPlatformDialog::QQuickLabsPlatformDialog(QPlatformTheme::DialogType type, QObject *parent)
64 m_parentWindow(
nullptr),
66 m_modality(Qt::WindowModal),
83
84
85
86
87
88
91 return QQmlListProperty<QObject>(
this, &m_data);
95
96
97
98
99
100
101
102
105 return m_parentWindow;
110 if (m_parentWindow == window)
113 m_parentWindow = window;
114 emit parentWindowChanged();
118
119
120
121
129 if (m_title == title)
137
138
139
140
148 if (m_flags == flags)
156
157
158
159
160
161
162
163
164
172 if (m_modality == modality)
175 m_modality = modality;
176 emit modalityChanged();
180
181
182
183
184
185
188 return m_handle && m_visible;
200
201
202
203
204
205
206
207
208
209
210
218 if (m_result == result)
222 emit resultChanged();
226
227
228
229
230
231
238 m_visible = m_handle->show(m_flags, m_modality, m_parentWindow);
240 emit visibleChanged();
244
245
246
247
248
249
252 if (!m_handle || !m_visible)
258 emit visibleChanged();
262
263
264
265
266
267
274
275
276
277
278
279
286
287
288
289
290
291
316 return object->metaObject()->className() + qstrlen(
"QQuickLabsPlatform");
322 if (useNativeDialog())
323 m_handle = QGuiApplicationPrivate::platformTheme()->createPlatformDialogHelper(m_type);
325 m_handle = QWidgetPlatform::createDialog(m_type,
this);
326 qCDebug(qtLabsPlatformDialogs) << qmlTypeName(
this) <<
"->" << m_handle;
344 return !QCoreApplication::testAttribute(Qt::AA_DontUseNativeDialogs)
345 && QGuiApplicationPrivate::platformTheme()->usePlatformNativeDialog(m_type);
365 QObject *obj = parent();
367 QWindow *window = qobject_cast<QWindow *>(obj);
370 QQuickItem *item = qobject_cast<QQuickItem *>(obj);
371 if (item && item->window())
372 return item->window();
380#include "moc_qquicklabsplatformdialog_p.cpp"
Combined button and popup list for selecting options.