Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. mouseQuickSelectionThreshold isn't set to the correct default value on Windows
Forum Update on Monday, May 27th 2025

mouseQuickSelectionThreshold isn't set to the correct default value on Windows

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 142 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    david_fmod
    wrote on last edited by
    #1

    In Qt 5.11, the mouseQuickSelectionThreshold style hint was added; see https://eang.it/new-in-qt-5-11-quick-text-selection-in-qlineedit/ and https://codereview.qt-project.org/c/qt/qtbase/+/192811.

    The default value for this style hint is 10: https://github.com/qt/qtbase/blob/dev/src/gui/kernel/qplatformtheme.cpp#L565

    The Windows platform integration doesn't override this value: https://github.com/qt/qtbase/blob/dev/src/plugins/platforms/windows/qwindowsintegration.cpp#L585

    This results in QLineEdit widgets not behaving like normal Windows text boxes, which ignore all vertical cursor movement when determining selection. Instead the QLineEdit widgets are defaulting to the MacOS-like behaviour that was added in the changes above. The default value should be -1 on Windows, to disable the quick-selection behaviour entirely - this seems to be an oversight and a bug.

    I've tried setting the threshold value in the object returned from QGuiApplication::styleHints, but I've not noticed any change from doing so, and the documentation indicates that the QStyleHints object is read-only (despite having setter functions). Also note that the setMouseQuickSelectionThreshold is marked as internal and thus doesn't appear in the documentation.

    Is there a way I can override this threshold value to -1 to disable this behaviour globally in our application?

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Modify the Qt source code and (even better) provide a patch to read the value from windows settings.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved