aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquicktextinput_p_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-02-02 17:51:16 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-03-05 22:45:13 +0000
commitb419ca92bef624893fa46559186b207905bc45e0 (patch)
tree6a6bcee25b606161b2c89f284fb3af532cd69b0e /src/quick/items/qquicktextinput_p_p.h
parente7c18e2a2b39f35667e76aaafa7135bde161a806 (diff)
TextInput: add support for padding
This makes it possible for TextField to inherit TextInput, reserve space for the decoration, and set the desired property defaults without having to create dozens of property aliases. [ChangeLog][QtQuick][TextInput] Added padding, leftPadding, topPadding, rightPadding and bottomPadding properties. Task-number: QTBUG-41559 Change-Id: Iaa7697a10a6f66685c7cae454edf4c1984d411bc Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'src/quick/items/qquicktextinput_p_p.h')
-rw-r--r--src/quick/items/qquicktextinput_p_p.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/quick/items/qquicktextinput_p_p.h b/src/quick/items/qquicktextinput_p_p.h
index 7596eae570..bb08c6226e 100644
--- a/src/quick/items/qquicktextinput_p_p.h
+++ b/src/quick/items/qquicktextinput_p_p.h
@@ -74,6 +74,15 @@ public:
QQuickTextInputPrivate()
: hscroll(0)
, vscroll(0)
+ , padding(0)
+ , topPadding(0)
+ , leftPadding(0)
+ , rightPadding(0)
+ , bottomPadding(0)
+ , explicitTopPadding(false)
+ , explicitLeftPadding(false)
+ , explicitRightPadding(false)
+ , explicitBottomPadding(false)
, cursorItem(0)
, textNode(0)
, m_maskData(0)
@@ -189,6 +198,16 @@ public:
qreal hscroll;
qreal vscroll;
+ qreal padding;
+ qreal topPadding;
+ qreal leftPadding;
+ qreal rightPadding;
+ qreal bottomPadding;
+ bool explicitTopPadding;
+ bool explicitLeftPadding;
+ bool explicitRightPadding;
+ bool explicitBottomPadding;
+
QTextLayout m_textLayout;
QString m_text;
QString m_inputMask;
@@ -420,6 +439,11 @@ public:
qreal getImplicitWidth() const Q_DECL_OVERRIDE;
+ void setTopPadding(qreal value, bool reset = false);
+ void setLeftPadding(qreal value, bool reset = false);
+ void setRightPadding(qreal value, bool reset = false);
+ void setBottomPadding(qreal value, bool reset = false);
+
private:
void removeSelectedText();
void internalSetText(const QString &txt, int pos = -1, bool edited = true);