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
qquicklabsplatformmessagedialog.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 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
5
6#include <QtQml/qqmlinfo.h>
7
9
14
198
207{
208 return m_options->text();
209}
210
212{
213 if (m_options->text() == text)
214 return;
215
216 m_options->setText(text);
218}
219
233
235{
236 if (m_options->informativeText() == text)
237 return;
238
239 m_options->setInformativeText(text);
241}
242
251{
252 return m_options->detailedText();
253}
254
256{
257 if (m_options->detailedText() == text)
258 return;
259
260 m_options->setDetailedText(text);
262}
263
293QPlatformDialogHelper::StandardButtons QQuickLabsPlatformMessageDialog::buttons() const
294{
295 return m_options->standardButtons();
296}
297
298void QQuickLabsPlatformMessageDialog::setButtons(QPlatformDialogHelper::StandardButtons buttons)
299{
300 if (m_options->standardButtons() == buttons)
301 return;
302
303 m_options->setStandardButtons(buttons);
305}
306
308{
309 if (QPlatformMessageDialogHelper *messageDialog = qobject_cast<QPlatformMessageDialogHelper *>(dialog)) {
310 connect(messageDialog, &QPlatformMessageDialogHelper::clicked, this, &QQuickLabsPlatformMessageDialog::handleClick);
311 messageDialog->setOptions(m_options);
312 }
313}
314
316{
317 m_options->setWindowTitle(title());
318 if (QPlatformMessageDialogHelper *messageDialog = qobject_cast<QPlatformMessageDialogHelper *>(dialog))
319 messageDialog->setOptions(m_options);
320}
321
322void QQuickLabsPlatformMessageDialog::handleClick(QPlatformDialogHelper::StandardButton button)
323{
324 done(button);
326
327 switch (button) {
346 default: qmlWarning(this) << "unknown button" << int(button); break;
347 }
348}
349
351
352#include "moc_qquicklabsplatformmessagedialog_p.cpp"
void setWindowTitle(const QString &)
void setInformativeText(const QString &text)
void setDetailedText(const QString &text)
void setText(const QString &text)
void setStandardButtons(QPlatformDialogHelper::StandardButtons buttons)
QPlatformDialogHelper::StandardButtons standardButtons() const
\inmodule QtCore
Definition qobject.h:103
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
The QPlatformDialogHelper class allows for platform-specific customization of dialogs.
The QPlatformMessageDialogHelper class allows for platform-specific customization of Message dialogs.
void clicked(QPlatformDialogHelper::StandardButton button, QPlatformDialogHelper::ButtonRole role)
The QPlatformTheme class allows customizing the UI based on themes.
void onShow(QPlatformDialogHelper *dialog) override
QPlatformDialogHelper::StandardButtons buttons
void onCreate(QPlatformDialogHelper *dialog) override
void clicked(QPlatformDialogHelper::StandardButton button)
void setButtons(QPlatformDialogHelper::StandardButtons buttons)
QQuickLabsPlatformMessageDialog(QObject *parent=nullptr)
A native message dialog.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QString text
QPushButton * button
[2]
Combined button and popup list for selecting options.
SharedPointerFileDialogOptions m_options
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
#define emit
QFileDialog dialog(this)
[1]
view create()