aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2018-07-24 14:07:27 +0200
committerMitch Curtis <mitch.curtis@qt.io>2018-07-24 12:55:04 +0000
commit4e11d09fdef369af130c86a81df599ee3273ac7d (patch)
treea3ecc70823aab1f8a81637768e2aa2f20a30d471
parent449c9c2474da0461c14e7d6ea12ff4e35c3c7aae (diff)
Doc: add a note about the best way to set padding
As the styles are subject to change over time, it's best to use the most fine-grained properties for specifying padding (topPadding, bottomPadding, etc.). Using these specific properties will ensure that what the user specifies always wins over what the style specifies. Task-number: QTBUG-69551 Change-Id: I4163e9918010fad0cb6ec701b49dbc59b086cf47 Reviewed-by: J-P Nurmi <jpnurmi@gmail.com>
-rw-r--r--src/quicktemplates2/qquickcontrol.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp
index 28e8c429..4ac12dc4 100644
--- a/src/quicktemplates2/qquickcontrol.cpp
+++ b/src/quicktemplates2/qquickcontrol.cpp
@@ -828,6 +828,26 @@ qreal QQuickControl::availableHeight() const
\li \l {Control::}{bottomPadding}
\endlist
+ \note Different styles may specify the default padding for certain controls
+ in different ways, and these ways may change over time as the design
+ guidelines that the style is based on evolve. To ensure that these changes
+ don't affect the padding values you have specified, it is best to use the
+ most specific properties available. For example, rather than setting
+ the \l padding property:
+
+ \code
+ padding: 0
+ \endcode
+
+ set each specific property instead:
+
+ \code
+ leftPadding: 0
+ rightPadding: 0
+ topPadding: 0
+ bottomPadding: 0
+ \endcode
+
\sa {Control Layout}, availableWidth, availableHeight, topPadding, leftPadding, rightPadding, bottomPadding
*/
qreal QQuickControl::padding() const