7#if QT_DEPRECATED_SINCE(6
, 9
)
9#include <QtQml/qqmlinfo.h>
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
84
85
86
87
88
89
92
93
94
95
98
99
100
101
104
105
106
107
110
111
112
113
116
117
118
119
122
123
124
125
128
129
130
131
134
135
136
137
140
141
142
143
146
147
148
149
152
153
154
155
158
159
160
161
164
165
166
167
170
171
172
173
176
177
178
179
182
183
184
185
188
189
190
191
194
195
196
197
199QQuickLabsPlatformMessageDialog::QQuickLabsPlatformMessageDialog(QObject *parent)
200 : QQuickLabsPlatformDialog(QPlatformTheme::MessageDialog, parent),
201 m_options(QMessageDialogOptions::create())
206
207
208
209
210
211
212QString QQuickLabsPlatformMessageDialog::text()
const
214 return m_options->text();
217void QQuickLabsPlatformMessageDialog::setText(
const QString &text)
219 if (m_options->text() == text)
222 m_options->setText(text);
227
228
229
230
231
232
233
234
235QString QQuickLabsPlatformMessageDialog::informativeText()
const
237 return m_options->informativeText();
240void QQuickLabsPlatformMessageDialog::setInformativeText(
const QString &text)
242 if (m_options->informativeText() == text)
245 m_options->setInformativeText(text);
246 emit informativeTextChanged();
250
251
252
253
254
255
256QString QQuickLabsPlatformMessageDialog::detailedText()
const
258 return m_options->detailedText();
261void QQuickLabsPlatformMessageDialog::setDetailedText(
const QString &text)
263 if (m_options->detailedText() == text)
266 m_options->setDetailedText(text);
267 emit detailedTextChanged();
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299QPlatformDialogHelper::StandardButtons QQuickLabsPlatformMessageDialog::buttons()
const
301 return m_options->standardButtons();
304void QQuickLabsPlatformMessageDialog::setButtons(QPlatformDialogHelper::StandardButtons buttons)
306 if (m_options->standardButtons() == buttons)
309 m_options->setStandardButtons(buttons);
310 emit buttonsChanged();
313void QQuickLabsPlatformMessageDialog::onCreate(QPlatformDialogHelper *dialog)
315 if (QPlatformMessageDialogHelper *messageDialog = qobject_cast<QPlatformMessageDialogHelper *>(dialog)) {
316 connect(messageDialog, &QPlatformMessageDialogHelper::clicked,
this, &QQuickLabsPlatformMessageDialog::handleClick);
317 messageDialog->setOptions(m_options);
321void QQuickLabsPlatformMessageDialog::onShow(QPlatformDialogHelper *dialog)
323 m_options->setWindowTitle(title());
324 if (QPlatformMessageDialogHelper *messageDialog = qobject_cast<QPlatformMessageDialogHelper *>(dialog))
325 messageDialog->setOptions(m_options);
328void QQuickLabsPlatformMessageDialog::handleClick(QPlatformDialogHelper::StandardButton button)
331 emit clicked(button);
334 case QPlatformDialogHelper::Ok: emit okClicked();
break;
335 case QPlatformDialogHelper::Save: emit saveClicked();
break;
336 case QPlatformDialogHelper::SaveAll: emit saveAllClicked();
break;
337 case QPlatformDialogHelper::Open: emit openClicked();
break;
338 case QPlatformDialogHelper::Yes: emit yesClicked();
break;
339 case QPlatformDialogHelper::YesToAll: emit yesToAllClicked();
break;
340 case QPlatformDialogHelper::No: emit noClicked();
break;
341 case QPlatformDialogHelper::NoToAll: emit noToAllClicked();
break;
342 case QPlatformDialogHelper::Abort: emit abortClicked();
break;
343 case QPlatformDialogHelper::Retry: emit retryClicked();
break;
344 case QPlatformDialogHelper::Ignore: emit ignoreClicked();
break;
345 case QPlatformDialogHelper::Close: emit closeClicked();
break;
346 case QPlatformDialogHelper::Cancel: emit cancelClicked();
break;
347 case QPlatformDialogHelper::Discard: emit discardClicked();
break;
348 case QPlatformDialogHelper::Help: emit helpClicked();
break;
349 case QPlatformDialogHelper::Apply: emit applyClicked();
break;
350 case QPlatformDialogHelper::Reset: emit resetClicked();
break;
351 case QPlatformDialogHelper::RestoreDefaults: emit restoreDefaultsClicked();
break;
352 default: qmlWarning(
this) <<
"unknown button" <<
int(button);
break;
358#include "moc_qquicklabsplatformmessagedialog_p.cpp"