From 417a2210725f4aad83688b494fbc9d45342c134a Mon Sep 17 00:00:00 2001 From: Eike Hein Date: Thu, 9 Apr 2015 23:36:38 +0200 Subject: Expose ItemViewActivateItemOnSingleClick in QStyleHints This completes support for ItemViewActivateItemOnSingleClick in QPlatformIntegration and exposes the setting in QStyleHints. Based on the review process, the public name used is 'singleClickActivation' for brevity, as well as to avoid con- fusion over alluding to "item views" in the Qt Quick context. KDE Plasma intends to use this via Qt.styleHints to have Qt Quick-based UI correctly implement the global single vs. double click user preference for item activation. [ChangeLog][QtGui] Added QStyleHints::singleClickActivation to access whether the platform expects item activation to occur on single clicks rather than double clicks. Change-Id: I0916e9e68c3a157f95053da8227b2612803653f7 Reviewed-by: Friedemann Kleint --- src/gui/kernel/qstylehints.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/gui/kernel/qstylehints.cpp') diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp index b7af2e759f..7ff0f9f860 100644 --- a/src/gui/kernel/qstylehints.cpp +++ b/src/gui/kernel/qstylehints.cpp @@ -377,4 +377,16 @@ Qt::TabFocusBehavior QStyleHints::tabFocusBehavior() const return Qt::TabFocusBehavior(themeableHint(QPlatformTheme::TabFocusBehavior, QPlatformIntegration::TabFocusBehavior).toInt()); } +/*! + \property QStyleHints::singleClickActivation + \brief \c true if items should be activated by single click, \b false + if they should be activated by double click instead. + + \since 5.5 +*/ +bool QStyleHints::singleClickActivation() const +{ + return themeableHint(QPlatformTheme::ItemViewActivateItemOnSingleClick, QPlatformIntegration::ItemViewActivateItemOnSingleClick).toBool(); +} + QT_END_NAMESPACE -- cgit v1.2.3