summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-02-08 14:54:15 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-02-08 14:38:11 +0000
commit146d54036664a3f19c2e6d2119f1a1d4acf55fa1 (patch)
treeceb7bfeb3256b8f19677512fe8a7e3bccfc93c31
parente6cc5382d9b789274d3e16e8601f33075b6a4b1c (diff)
Editors: fix mouse cursor
Read-only editors should not use the IBeam cursor, but switch to a plain arrow cursor. Change-Id: If579571ceff086af6b8259ade769b5efb27565db Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/quicktemplates2/qquicktextarea.cpp6
-rw-r--r--src/quicktemplates2/qquicktextfield.cpp6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/quicktemplates2/qquicktextarea.cpp b/src/quicktemplates2/qquicktextarea.cpp
index cf6b4274..5d710d4e 100644
--- a/src/quicktemplates2/qquicktextarea.cpp
+++ b/src/quicktemplates2/qquicktextarea.cpp
@@ -375,11 +375,13 @@ void QQuickTextAreaPrivate::updateHoverEnabled(bool enabled, bool xplicit)
void QQuickTextAreaPrivate::_q_readOnlyChanged(bool isReadOnly)
{
+ Q_UNUSED(isReadOnly);
#ifndef QT_NO_ACCESSIBILITY
if (accessibleAttached)
accessibleAttached->set_readOnly(isReadOnly);
-#else
- Q_UNUSED(isReadOnly)
+#endif
+#ifndef QT_NO_CURSOR
+ q_func()->setCursor(isReadOnly ? Qt::ArrowCursor : Qt::IBeamCursor);
#endif
}
diff --git a/src/quicktemplates2/qquicktextfield.cpp b/src/quicktemplates2/qquicktextfield.cpp
index 4c916381..2718b13e 100644
--- a/src/quicktemplates2/qquicktextfield.cpp
+++ b/src/quicktemplates2/qquicktextfield.cpp
@@ -239,11 +239,13 @@ void QQuickTextFieldPrivate::updateHoverEnabled(bool enabled, bool xplicit)
void QQuickTextFieldPrivate::_q_readOnlyChanged(bool isReadOnly)
{
+ Q_UNUSED(isReadOnly);
#ifndef QT_NO_ACCESSIBILITY
if (accessibleAttached)
accessibleAttached->set_readOnly(isReadOnly);
-#else
- Q_UNUSED(isReadOnly)
+#endif
+#ifndef QT_NO_CURSOR
+ q_func()->setCursor(isReadOnly ? Qt::ArrowCursor : Qt::IBeamCursor);
#endif
}