diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2011-08-31 10:47:09 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-08-31 11:47:21 +0200 |
commit | 94355ca15a4d451f4a4b858240e2c1a96e26537b (patch) | |
tree | 6b9209c03a86575a45c92e62a990c60528c02195 /src/gui/text/qlinecontrol.cpp | |
parent | 3795e2c7bec9eb50a04d139e45ecc809c4aa37f6 (diff) |
Add a QStyleHints class to QtGui
This class encapsulates platform specific style hints
like doubleClickInterval or cursorFlashTime.
Change-Id: I0d88c47a59d564d8d346642184e5b14e1864cf40
Reviewed-on: http://codereview.qt.nokia.com/3927
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui/text/qlinecontrol.cpp')
-rw-r--r-- | src/gui/text/qlinecontrol.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gui/text/qlinecontrol.cpp b/src/gui/text/qlinecontrol.cpp index 36c064ee40..6f9d9402ee 100644 --- a/src/gui/text/qlinecontrol.cpp +++ b/src/gui/text/qlinecontrol.cpp @@ -56,12 +56,11 @@ #include "qlist.h" #endif #include "qguiapplication.h" +#include "qstylehints.h" QT_BEGIN_NAMESPACE -// ### these should come from the application -const int startDragDistance = 10; -const int cursorFlashTime = 2000; +// ### these should come from QStyleHints const int textCursorWidth = 1; const bool fullWidthSelection = true; @@ -1394,8 +1393,7 @@ void QLineControl::processMouseEvent(QMouseEvent* ev) switch (ev->type()) { case QEvent::MouseButtonPress:{ if (m_tripleClickTimer - && (ev->pos() - m_tripleClick).manhattanLength() - < startDragDistance) { + && (ev->pos() - m_tripleClick).manhattanLength() < qApp->styleHints()->startDragDistance()) { selectAll(); return; } @@ -1412,7 +1410,7 @@ void QLineControl::processMouseEvent(QMouseEvent* ev) selectWordAtPos(xToPos(ev->pos().x())); if (m_tripleClickTimer) killTimer(m_tripleClickTimer); - m_tripleClickTimer = startTimer(QGuiApplication::doubleClickInterval()); + m_tripleClickTimer = startTimer(qApp->styleHints()->mouseDoubleClickInterval()); m_tripleClick = ev->pos(); } break; |