Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickmessagedialogimpl_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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKMESSAGEDIALOGIMPL_P_H
6#define QQUICKMESSAGEDIALOGIMPL_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuickTemplates2/private/qquickdialog_p.h>
20#include <QtQuickTemplates2/private/qquicklabel_p.h>
21#include <QtQuickTemplates2/private/qquickdialogbuttonbox_p.h>
22#include <QtQuickTemplates2/private/qquicktextarea_p.h>
23#include <QtQuickTemplates2/private/qquickbutton_p.h>
24
26
27QT_BEGIN_NAMESPACE
28
29class QQuickMessageDialogImplAttached;
32
33class Q_QUICKDIALOGS2QUICKIMPL_EXPORT QQuickMessageDialogImpl : public QQuickDialog
34{
35 Q_OBJECT
36 Q_PROPERTY(QString text READ text NOTIFY optionsChanged)
37 Q_PROPERTY(QString informativeText READ informativeText NOTIFY optionsChanged)
38 Q_PROPERTY(QString detailedText READ detailedText NOTIFY optionsChanged)
39 Q_PROPERTY(bool showDetailedText READ showDetailedText NOTIFY showDetailedTextChanged)
40 QML_NAMED_ELEMENT(MessageDialogImpl)
41 QML_ATTACHED(QQuickMessageDialogImplAttached)
42 QML_ADDED_IN_VERSION(6, 3)
43public:
44 explicit QQuickMessageDialogImpl(QObject *parent = nullptr);
45
46 static QQuickMessageDialogImplAttached *qmlAttachedProperties(QObject *object);
47
48 QSharedPointer<QMessageDialogOptions> options() const;
49 void setOptions(const QSharedPointer<QMessageDialogOptions> &options);
50
51 bool showDetailedText() const;
52 QString text() const;
53 QString informativeText() const;
54 QString detailedText() const;
55
56Q_SIGNALS:
57 void buttonClicked(QPlatformDialogHelper::StandardButton button,
58 QPlatformDialogHelper::ButtonRole role);
59 void showDetailedTextChanged();
60 void optionsChanged();
61
62public Q_SLOTS:
63 void toggleShowDetailedText();
64
65private:
66 Q_DISABLE_COPY(QQuickMessageDialogImpl)
67 Q_DECLARE_PRIVATE(QQuickMessageDialogImpl)
68};
69
70class Q_QUICKDIALOGS2QUICKIMPL_EXPORT QQuickMessageDialogImplAttached : public QObject
71{
72 Q_OBJECT
73 Q_PROPERTY(QQuickDialogButtonBox *buttonBox READ buttonBox WRITE setButtonBox NOTIFY
74 buttonBoxChanged)
75 Q_PROPERTY(QQuickButton *detailedTextButton READ detailedTextButton WRITE setDetailedTextButton
76 NOTIFY detailedTextButtonChanged)
77public:
78 explicit QQuickMessageDialogImplAttached(QObject *parent = nullptr);
79
80 QQuickDialogButtonBox *buttonBox() const;
81 void setButtonBox(QQuickDialogButtonBox *buttons);
82
83 QQuickButton *detailedTextButton() const;
84 void setDetailedTextButton(QQuickButton *detailedTextButton);
85
86Q_SIGNALS:
87 void buttonBoxChanged();
88 void detailedTextButtonChanged();
89
90private:
91 Q_DISABLE_COPY(QQuickMessageDialogImplAttached)
92 Q_DECLARE_PRIVATE(QQuickMessageDialogImplAttached)
93};
94
95QT_END_NAMESPACE
96
97#endif // QQUICKMESSAGEDIALOGIMPL_P_H
QQuickMessageDialogImplAttached * attachedOrWarn()
void handleClick(QQuickAbstractButton *button) override