summaryrefslogtreecommitdiff
path: root/src/dialogs/qquickabstractdialog_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/qquickabstractdialog_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/qquickabstractdialog_p.h')
-rw-r--r--src/dialogs/qquickabstractdialog_p.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/dialogs/qquickabstractdialog_p.h b/src/dialogs/qquickabstractdialog_p.h
index 8ffa166c..5a408530 100644
--- a/src/dialogs/qquickabstractdialog_p.h
+++ b/src/dialogs/qquickabstractdialog_p.h
@@ -63,6 +63,9 @@ QT_BEGIN_NAMESPACE
class QQuickAbstractDialog : public QObject
{
Q_OBJECT
+ // TODO move the enum to QQuickDialog at the same time that QQuickMessageDialog inherits from it
+ Q_ENUMS(StandardButton)
+ Q_FLAGS(StandardButtons)
Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibilityChanged)
Q_PROPERTY(Qt::WindowModality modality READ modality WRITE setModality NOTIFY modalityChanged)
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
@@ -92,6 +95,30 @@ public:
void setQmlImplementation(QObject* obj);
bool isWindow() const { return m_hasNativeWindows; }
+ 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,
+ NButtons
+ };
+ Q_DECLARE_FLAGS(StandardButtons, StandardButton)
+
public Q_SLOTS:
void open() { setVisible(true); }
void close() { setVisible(false); }
@@ -114,6 +141,8 @@ protected Q_SLOTS:
virtual void reject();
void visibleChanged(bool v);
void windowGeometryChanged();
+ void minimumWidthChanged();
+ void minimumHeightChanged();
protected:
virtual QPlatformDialogHelper *helper() = 0;
@@ -140,6 +169,8 @@ protected: // variables for pure-QML implementations only
Q_DISABLE_COPY(QQuickAbstractDialog)
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(QQuickAbstractDialog::StandardButtons)
+
QT_END_NAMESPACE
#endif // QQUICKABSTRACTDIALOG_P_H