aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlengine.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-01-02 15:41:02 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-01-17 20:40:17 +0100
commit99b19fab5a106cbc34f2733da6689eb0afbc36e5 (patch)
tree00672b0126900b501e461faa907c745dba5df43e /src/qml/qml/qqmlengine.cpp
parent8d2227165723c76dbebb348f569a477f8e699870 (diff)
Expose QStyleHints as Qt.styleHints
Change-Id: I0fc94e680b011963e645bdbf51110820751e53aa Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlengine.cpp')
-rw-r--r--src/qml/qml/qqmlengine.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index aececf915f..762e9880d2 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -523,6 +523,34 @@ The following functions are also on the Qt object.
further details.
*/
+/*!
+ \qmlproperty object Qt::styleHints
+ \since 5.5
+
+ The \c styleHints object provides platform-specific style hints and settings.
+ See the QStyleHints documentation for further details.
+
+ \note The \c styleHints object is only available when using the Qt Quick module.
+
+ The following example uses the \c styleHints object to determine whether an
+ item should gain focus on mouse press or touch release:
+ \code
+ import QtQuick 2.4
+
+ MouseArea {
+ id: button
+
+ onPressed: {
+ if (!Qt.styleHints.setFocusOnTouchRelease)
+ button.forceActiveFocus()
+ }
+ onReleased: {
+ if (Qt.styleHints.setFocusOnTouchRelease)
+ button.forceActiveFocus()
+ }
+ }
+ \endcode
+*/
/*!
\qmlmethod object Qt::include(string url, jsobject callback)