diff options
author | Jani Heikkinen <jani.heikkinen@qt.io> | 2018-02-10 20:39:02 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2018-02-10 20:39:02 +0000 |
commit | 095dbc494c6cb9815b0d9b521a3105b06f4bef33 (patch) | |
tree | ec5b2ac5777406a533e820f21b5705b209855a0d /src/gui/kernel/qstylehints.cpp | |
parent | 0b48fcee709ac0070d7b9213632edeafeeddc9e1 (diff) | |
parent | 32b506d1db1f8cee748a27b548ba8208f2928058 (diff) |
Merge "Merge remote-tracking branch 'origin/dev' into 5.11" into refs/staging/5.11
Diffstat (limited to 'src/gui/kernel/qstylehints.cpp')
-rw-r--r-- | src/gui/kernel/qstylehints.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/gui/kernel/qstylehints.cpp b/src/gui/kernel/qstylehints.cpp index 0850228ee5..b2d968c046 100644 --- a/src/gui/kernel/qstylehints.cpp +++ b/src/gui/kernel/qstylehints.cpp @@ -79,6 +79,7 @@ public: , m_tabFocusBehavior(-1) , m_uiEffects(-1) , m_wheelScrollLines(-1) + , m_mouseQuickSelectionThreshold(-1) {} int m_mouseDoubleClickInterval; @@ -90,6 +91,7 @@ public: int m_tabFocusBehavior; int m_uiEffects; int m_wheelScrollLines; + int m_mouseQuickSelectionThreshold; }; /*! @@ -537,4 +539,38 @@ void QStyleHints::setWheelScrollLines(int scrollLines) emit wheelScrollLinesChanged(scrollLines); } +/*! + Sets the mouse quick selection threshold. + \internal + \sa mouseQuickSelectionThreshold() + \since 5.11 +*/ +void QStyleHints::setMouseQuickSelectionThreshold(int threshold) +{ + Q_D(QStyleHints); + if (d->m_mouseQuickSelectionThreshold == threshold) + return; + d->m_mouseQuickSelectionThreshold = threshold; + emit mouseDoubleClickIntervalChanged(threshold); +} + +/*! + \property QStyleHints::mouseQuickSelectionThreshold + \brief Quick selection mouse threshold in QLineEdit. + + This property defines how much the mouse cursor should be moved along the y axis + to trigger a quick selection during a normal QLineEdit text selection. + + If the property value is less than or equal to 0, the quick selection feature is disabled. + + \since 5.11 +*/ +int QStyleHints::mouseQuickSelectionThreshold() const +{ + Q_D(const QStyleHints); + if (d->m_mouseQuickSelectionThreshold >= 0) + return d->m_mouseQuickSelectionThreshold; + return themeableHint(QPlatformTheme::MouseQuickSelectionThreshold, QPlatformIntegration::MouseQuickSelectionThreshold).toInt(); +} + QT_END_NAMESPACE |