summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/kernel/qplatformintegration.cpp2
-rw-r--r--src/gui/kernel/qplatformintegration.h3
-rw-r--r--src/gui/kernel/qplatformtheme.cpp2
-rw-r--r--src/gui/kernel/qstylehints.cpp12
-rw-r--r--src/gui/kernel/qstylehints.h2
5 files changed, 20 insertions, 1 deletions
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp
index f917c09f6d..4d973d47a5 100644
--- a/src/gui/kernel/qplatformintegration.cpp
+++ b/src/gui/kernel/qplatformintegration.cpp
@@ -396,6 +396,8 @@ QVariant QPlatformIntegration::styleHint(StyleHint hint) const
return QPlatformTheme::defaultThemeHint(QPlatformTheme::TabFocusBehavior);
case ReplayMousePressOutsidePopup:
return true;
+ case ItemViewActivateItemOnSingleClick:
+ return QPlatformTheme::defaultThemeHint(QPlatformTheme::ItemViewActivateItemOnSingleClick);
}
return 0;
diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h
index 473c75a9e0..2aa502b3d2 100644
--- a/src/gui/kernel/qplatformintegration.h
+++ b/src/gui/kernel/qplatformintegration.h
@@ -147,7 +147,8 @@ public:
ShowIsMaximized,
MousePressAndHoldInterval,
TabFocusBehavior,
- ReplayMousePressOutsidePopup
+ ReplayMousePressOutsidePopup,
+ ItemViewActivateItemOnSingleClick
};
virtual QVariant styleHint(StyleHint hint) const;
diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp
index aa49d64309..36a71fe2da 100644
--- a/src/gui/kernel/qplatformtheme.cpp
+++ b/src/gui/kernel/qplatformtheme.cpp
@@ -434,6 +434,8 @@ QVariant QPlatformTheme::themeHint(ThemeHint hint) const
return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::PasswordMaskCharacter);
case QPlatformTheme::MousePressAndHoldInterval:
return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::MousePressAndHoldInterval);
+ case QPlatformTheme::ItemViewActivateItemOnSingleClick:
+ return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::ItemViewActivateItemOnSingleClick);
default:
return QPlatformTheme::defaultThemeHint(hint);
}
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
diff --git a/src/gui/kernel/qstylehints.h b/src/gui/kernel/qstylehints.h
index 5fbc851ee9..82eb8a6f7d 100644
--- a/src/gui/kernel/qstylehints.h
+++ b/src/gui/kernel/qstylehints.h
@@ -61,6 +61,7 @@ class Q_GUI_EXPORT QStyleHints : public QObject
Q_PROPERTY(int startDragVelocity READ startDragVelocity STORED false CONSTANT FINAL)
Q_PROPERTY(bool useRtlExtensions READ useRtlExtensions STORED false CONSTANT FINAL)
Q_PROPERTY(Qt::TabFocusBehavior tabFocusBehavior READ tabFocusBehavior STORED false CONSTANT FINAL)
+ Q_PROPERTY(bool singleClickActivation READ singleClickActivation STORED false CONSTANT FINAL)
public:
void setMouseDoubleClickInterval(int mouseDoubleClickInterval);
@@ -83,6 +84,7 @@ public:
bool useRtlExtensions() const;
bool setFocusOnTouchRelease() const;
Qt::TabFocusBehavior tabFocusBehavior() const;
+ bool singleClickActivation() const;
Q_SIGNALS:
void cursorFlashTimeChanged(int cursorFlashTime);