From e3ae141989743b62dd4acc565801ff0898897065 Mon Sep 17 00:00:00 2001 From: Raino Priha Date: Tue, 2 Mar 2010 15:38:29 +0200 Subject: Allow platform specific values for the double click radius. Task-number: QT-2883 Reviewed-by: Volker Hilsheimer --- mkspecs/linux-g++-maemo/qplatformdefs.h | 2 ++ src/gui/kernel/qapplication.cpp | 4 ++++ src/gui/kernel/qapplication_x11.cpp | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mkspecs/linux-g++-maemo/qplatformdefs.h b/mkspecs/linux-g++-maemo/qplatformdefs.h index 7e8d1d4..d7feb9e 100644 --- a/mkspecs/linux-g++-maemo/qplatformdefs.h +++ b/mkspecs/linux-g++-maemo/qplatformdefs.h @@ -40,3 +40,5 @@ ****************************************************************************/ #include "../linux-g++/qplatformdefs.h" + +#define QT_GUI_DOUBLE_CLICK_RADIUS 20 diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 4fe3900..6dda961 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -117,6 +117,10 @@ extern bool qt_wince_is_pocket_pc(); //qguifunctions_wince.cpp #include #endif +#ifndef QT_GUI_DOUBLE_CLICK_RADIUS +#define QT_GUI_DOUBLE_CLICK_RADIUS 5 +#endif + //#define ALIEN_DEBUG static void initResources() diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp index afd927b..15761f4 100644 --- a/src/gui/kernel/qapplication_x11.cpp +++ b/src/gui/kernel/qapplication_x11.cpp @@ -4215,8 +4215,8 @@ bool QETWidget::translateMouseEvent(const XEvent *event) mouseButtonPressed == button && (long)event->xbutton.time -(long)mouseButtonPressTime < QApplication::doubleClickInterval() && - qAbs(event->xbutton.x - mouseXPos) < 5 && - qAbs(event->xbutton.y - mouseYPos) < 5) { + qAbs(event->xbutton.x - mouseXPos) < QT_GUI_DOUBLE_CLICK_RADIUS && + qAbs(event->xbutton.y - mouseYPos) < QT_GUI_DOUBLE_CLICK_RADIUS) { type = QEvent::MouseButtonDblClick; mouseButtonPressTime -= 2000; // no double-click next time } else { -- cgit v0.12