aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquicktextfield_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2018-05-02 14:04:53 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2018-05-02 13:43:20 +0000
commit6858d4e9873644c255b19d251e5522c7cf4b7160 (patch)
tree93d5c83e841f084aea0a67ddfab6897d4e9052ec /src/quicktemplates2/qquicktextfield_p.h
parent89495f409fcb04f5eeb1c1e06096fcb54065c969 (diff)
TextField: add support for background insets
Same as 5adce042 for QQuickControl. [ChangeLog][Controls][TextField] Added topInset, bottomInset, leftInset, and rightInset properties to control the geometry of the background similarly to how paddings control the geometry of the contentItem. Change-Id: Ic1e4c15fd4b06a58f229b5156668c9a986f7bc3f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquicktextfield_p.h')
-rw-r--r--src/quicktemplates2/qquicktextfield_p.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquicktextfield_p.h b/src/quicktemplates2/qquicktextfield_p.h
index b1f2c974..d0d25d70 100644
--- a/src/quicktemplates2/qquicktextfield_p.h
+++ b/src/quicktemplates2/qquicktextfield_p.h
@@ -76,6 +76,10 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickTextField : public QQuickTextInput
Q_PROPERTY(QColor placeholderTextColor READ placeholderTextColor WRITE setPlaceholderTextColor NOTIFY placeholderTextColorChanged 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")
public:
@@ -114,6 +118,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();
+
Q_SIGNALS:
void fontChanged();
void implicitWidthChanged3();
@@ -133,6 +153,10 @@ Q_SIGNALS:
Q_REVISION(5) void placeholderTextColorChanged();
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:
void classBegin() override;
@@ -140,6 +164,8 @@ protected:
void itemChange(ItemChange change, const ItemChangeData &value) override;
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
+ virtual void insetChange(const QMarginsF &newInset, const QMarginsF &oldInset);
+
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) override;
void focusInEvent(QFocusEvent *event) override;