aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickpopup_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2018-04-19 22:11:16 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2018-04-23 06:16:13 +0000
commit31998a21d1ba1ea90a653696225e52f53f256c87 (patch)
tree3ec89636a4eb3f0eed17fb04541e84cd301356d2 /src/quicktemplates2/qquickpopup_p.h
parent5adce042aa8c75970eef4cc8a5492b8d644ffcf7 (diff)
Popup: add support for background insets
[ChangeLog][Controls][Popup] Added topInset, bottomInset, leftInset, and rightInset properties to control the geometry of the background similarly to how paddings control the geometry of the contentItem. Task-number: QTBUG-60156 Change-Id: I02873f129d2a804986d0db52d1b94899f9219c03 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickpopup_p.h')
-rw-r--r--src/quicktemplates2/qquickpopup_p.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickpopup_p.h b/src/quicktemplates2/qquickpopup_p.h
index 1d232e92..12dbd247 100644
--- a/src/quicktemplates2/qquickpopup_p.h
+++ b/src/quicktemplates2/qquickpopup_p.h
@@ -130,6 +130,10 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickPopup : public QObject, public QQml
Q_PROPERTY(qreal implicitContentHeight READ implicitContentHeight NOTIFY implicitContentHeightChanged FINAL REVISION 5)
Q_PROPERTY(qreal implicitBackgroundWidth READ implicitBackgroundWidth NOTIFY implicitBackgroundWidthChanged FINAL REVISION 5)
Q_PROPERTY(qreal implicitBackgroundHeight READ implicitBackgroundHeight NOTIFY implicitBackgroundHeightChanged FINAL REVISION 5)
+ Q_PROPERTY(qreal topInset READ topInset WRITE setTopInset RESET resetTopInset NOTIFY topInsetChanged FINAL REVISION 5)
+ Q_PROPERTY(qreal leftInset READ leftInset WRITE setLeftInset RESET resetLeftInset NOTIFY leftInsetChanged FINAL REVISION 5)
+ Q_PROPERTY(qreal rightInset READ rightInset WRITE setRightInset RESET resetRightInset NOTIFY rightInsetChanged FINAL REVISION 5)
+ Q_PROPERTY(qreal bottomInset READ bottomInset WRITE setBottomInset RESET resetBottomInset NOTIFY bottomInsetChanged FINAL REVISION 5)
Q_CLASSINFO("DeferredPropertyNames", "background,contentItem")
Q_CLASSINFO("DefaultProperty", "contentData")
@@ -325,6 +329,22 @@ public:
qreal implicitBackgroundWidth() const;
qreal implicitBackgroundHeight() const;
+ qreal topInset() const;
+ void setTopInset(qreal inset);
+ void resetTopInset();
+
+ qreal leftInset() const;
+ void setLeftInset(qreal inset);
+ void resetLeftInset();
+
+ qreal rightInset() const;
+ void setRightInset(qreal inset);
+ void resetRightInset();
+
+ qreal bottomInset() const;
+ void setBottomInset(qreal inset);
+ void resetBottomInset();
+
public Q_SLOTS:
void open();
void close();
@@ -387,6 +407,10 @@ Q_SIGNALS:
Q_REVISION(5) void implicitContentHeightChanged();
Q_REVISION(5) void implicitBackgroundWidthChanged();
Q_REVISION(5) void implicitBackgroundHeightChanged();
+ Q_REVISION(5) void topInsetChanged();
+ Q_REVISION(5) void leftInsetChanged();
+ Q_REVISION(5) void rightInsetChanged();
+ Q_REVISION(5) void bottomInsetChanged();
protected:
QQuickPopup(QQuickPopupPrivate &dd, QObject *parent);
@@ -424,6 +448,7 @@ protected:
virtual void paddingChange(const QMarginsF &newPadding, const QMarginsF &oldPadding);
virtual void paletteChange(const QPalette &newPalette, const QPalette &oldPalette);
virtual void spacingChange(qreal newSpacing, qreal oldSpacing);
+ virtual void insetChange(const QMarginsF &newInset, const QMarginsF &oldInset);
virtual QFont defaultFont() const;
virtual QPalette defaultPalette() const;