From 7cce9b87f8886132167e826e4acaf455ca2de124 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Tue, 27 Mar 2007 08:05:31 +0000 Subject: [PATCH] * src/frontends/qt4/GuiWorkArea.[Ch]: - reimplement doubleClickTimeout() from the qt3 frontend in order to get triple clicking working (bug 3272). This is just an emultation of triple clicking, since qt does not have a mouseTripleClickEvent() git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17588 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiWorkArea.C | 14 +++++++++++--- src/frontends/qt4/GuiWorkArea.h | 2 ++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt4/GuiWorkArea.C b/src/frontends/qt4/GuiWorkArea.C index 6d2b7b6094..65d6d27191 100644 --- a/src/frontends/qt4/GuiWorkArea.C +++ b/src/frontends/qt4/GuiWorkArea.C @@ -421,10 +421,8 @@ void GuiWorkArea::keyPressEvent(QKeyEvent * e) } -void GuiWorkArea::mouseDoubleClickEvent(QMouseEvent * e) +void GuiWorkArea::doubleClickTimeout() { - dc_event_ = double_click(e); - if (!dc_event_.active) return; @@ -437,6 +435,16 @@ void GuiWorkArea::mouseDoubleClickEvent(QMouseEvent * e) } +void GuiWorkArea::mouseDoubleClickEvent(QMouseEvent * e) +{ + dc_event_ = double_click(e); + + // doubleClickInterval() is just too long. + QTimer::singleShot(int(QApplication::doubleClickInterval() / 1.5), + this, SLOT(doubleClickTimeout())); +} + + void GuiWorkArea::resizeEvent(QResizeEvent * ev) { QAbstractScrollArea::resizeEvent(ev); diff --git a/src/frontends/qt4/GuiWorkArea.h b/src/frontends/qt4/GuiWorkArea.h index a6e2096101..1c126dd825 100644 --- a/src/frontends/qt4/GuiWorkArea.h +++ b/src/frontends/qt4/GuiWorkArea.h @@ -155,6 +155,8 @@ public Q_SLOTS: * emits an 'int' action. */ void adjustViewWithScrollBar(int action = 0); + /// + void doubleClickTimeout(); private: /// The slot connected to SyntheticMouseEvent::timeout. -- 2.39.2