From 4a2e297b4f091d212b184352fd2d3563c5ea5286 Mon Sep 17 00:00:00 2001 From: Pelle Johnsen Date: Wed, 20 Aug 2014 11:16:43 +0200 Subject: [PATCH] Replacement for QWS_DBLCLICK_DISTANCE Add QT_DBL_CLICK_DIST to replace QWS_DBLCLICK_DISTANCE for controlling the distance for detecting double clicks, which can be very useful on embedded devices [ChangeLog][QtGui] environment variable QT_DBL_CLICK_DIST customizes the amount of movement allowed when detecting a double click. Task-number: QTBUG-40841 Change-Id: I0a7534ad6cd6387d127eb49021a92d414d45670e Reviewed-by: Shawn Rutledge Reviewed-by: Laszlo Agocs --- src/gui/kernel/qplatformtheme.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index d3d3d3c222..d1b1106b28 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -508,7 +508,11 @@ QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint) case MousePressAndHoldInterval: return QVariant(800); case MouseDoubleClickDistance: - return QVariant(5); + { + bool ok = false; + int dist = qgetenv("QT_DBL_CLICK_DIST").toInt(&ok); + return QVariant(ok ? dist : 5); + } } return QVariant(); }