summaryrefslogtreecommitdiff
path: root/src/dialogs/qquickabstractmessagedialog_p.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2014-02-07 16:29:31 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-15 21:52:47 +0100
commitccb088a6beaff01419ec9325dbd19040f279b6ea (patch)
treeae1753ab02284a1fd69b30d6086a40b9faf6fc91 /src/dialogs/qquickabstractmessagedialog_p.h
parentf212322a6ecb237d5fb53e56c6dafffb87e45f09 (diff)
downloadqtquickcontrols-ccb088a6beaff01419ec9325dbd19040f279b6ea.tar.gz
QtQuick.Dialogs: added Dialog: wrapper for arbitrary content
It provides only a button box, so the application developer can supply the rest of the dialog contents. This is useful for various kinds of dialogs that prompt the user for input. [ChangeLog][QtQuickDialogs][Dialog] Dialog is a new wrapper component for dialogs with standard buttons and custom content items. Change-Id: I0434bed5f504820dc0a668cb993a94980f99852a Reviewed-by: Liang Qi <liang.qi@digia.com>
Diffstat (limited to 'src/dialogs/qquickabstractmessagedialog_p.h')
-rw-r--r--src/dialogs/qquickabstractmessagedialog_p.h37
1 files changed, 6 insertions, 31 deletions
diff --git a/src/dialogs/qquickabstractmessagedialog_p.h b/src/dialogs/qquickabstractmessagedialog_p.h
index 2afea1dc..3cf8ee47 100644
--- a/src/dialogs/qquickabstractmessagedialog_p.h
+++ b/src/dialogs/qquickabstractmessagedialog_p.h
@@ -66,16 +66,14 @@ class QQuickAbstractMessageDialog : public QQuickAbstractDialog
Q_OBJECT
Q_ENUMS(Icon)
- Q_ENUMS(StandardButton)
- Q_FLAGS(StandardButtons)
Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
Q_PROPERTY(QString informativeText READ informativeText WRITE setInformativeText NOTIFY informativeTextChanged)
Q_PROPERTY(QString detailedText READ detailedText WRITE setDetailedText NOTIFY detailedTextChanged)
Q_PROPERTY(Icon icon READ icon WRITE setIcon NOTIFY iconChanged)
Q_PROPERTY(QUrl standardIconSource READ standardIconSource NOTIFY iconChanged)
- Q_PROPERTY(StandardButtons standardButtons READ standardButtons WRITE setStandardButtons NOTIFY standardButtonsChanged)
- Q_PROPERTY(StandardButton clickedButton READ clickedButton NOTIFY buttonClicked)
+ Q_PROPERTY(QQuickAbstractDialog::StandardButtons standardButtons READ standardButtons WRITE setStandardButtons NOTIFY standardButtonsChanged)
+ Q_PROPERTY(QQuickAbstractDialog::StandardButton clickedButton READ clickedButton NOTIFY buttonClicked)
public:
QQuickAbstractMessageDialog(QObject *parent = 0);
@@ -98,29 +96,6 @@ public:
QUrl standardIconSource();
- enum StandardButton {
- NoButton = QPlatformDialogHelper::NoButton,
- Ok = QPlatformDialogHelper::Ok,
- Save = QPlatformDialogHelper::Save,
- SaveAll = QPlatformDialogHelper::SaveAll,
- Open = QPlatformDialogHelper::Open,
- Yes = QPlatformDialogHelper::Yes,
- YesToAll = QPlatformDialogHelper::YesToAll,
- No = QPlatformDialogHelper::No,
- NoToAll = QPlatformDialogHelper::NoToAll,
- Abort = QPlatformDialogHelper::Abort,
- Retry = QPlatformDialogHelper::Retry,
- Ignore = QPlatformDialogHelper::Ignore,
- Close = QPlatformDialogHelper::Close,
- Cancel = QPlatformDialogHelper::Cancel,
- Discard = QPlatformDialogHelper::Discard,
- Help = QPlatformDialogHelper::Help,
- Apply = QPlatformDialogHelper::Apply,
- Reset = QPlatformDialogHelper::Reset,
- RestoreDefaults = QPlatformDialogHelper::RestoreDefaults
- };
- Q_DECLARE_FLAGS(StandardButtons, StandardButton)
-
StandardButtons standardButtons() const { return static_cast<StandardButtons>(static_cast<int>(m_options->standardButtons())); }
StandardButton clickedButton() const { return m_clickedButton; }
@@ -133,8 +108,7 @@ public Q_SLOTS:
void setDetailedText(const QString &arg);
void setIcon(Icon icon);
void setStandardButtons(StandardButtons buttons);
- void click(QPlatformDialogHelper::StandardButton button, QPlatformDialogHelper::ButtonRole);
- void click(QQuickAbstractMessageDialog::StandardButton button);
+ void click(QQuickAbstractDialog::StandardButton button);
Q_SIGNALS:
void textChanged();
@@ -151,6 +125,9 @@ Q_SIGNALS:
void reset();
protected:
+ void click(QPlatformDialogHelper::StandardButton button, QPlatformDialogHelper::ButtonRole);
+
+protected:
QPlatformMessageDialogHelper *m_dlgHelper;
QSharedPointer<QMessageDialogOptions> m_options;
StandardButton m_clickedButton;
@@ -158,8 +135,6 @@ protected:
Q_DISABLE_COPY(QQuickAbstractMessageDialog)
};
-Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickAbstractMessageDialog::StandardButtons)
-
QT_END_NAMESPACE
#endif // QQUICKABSTRACTMESSAGEDIALOG_P_H