Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-106262

Mouse events use rounded float local pos

    XMLWordPrintable

Details

    • Windows
    • a5a925bf2 (dev), 045f5baf9 (6.6)

    Description

      QMouseEvent::localPos returns a PointF, however, in  the {{QWidgetWindow::}}handleMouseEvent function it has been rounded.

      In Qt 5.15.2, this is the line QPoint mapped = event->pos();

      Looking at the code of the latest Qt version, that still seems to be the case, though more explicit:

      qwidgetwindow.cpp\kernel\widgets\src - qt/qtbase.git - Qt Base (Core, Gui, Widgets, Network, ...)

      QPoint mapped = event->position().toPoint();

      This rounding means that for example with 200% DPI scaling, when clicking a widget, the selected pixel can't be properly calculated - only even pixels can be selected.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mkentie Marijn Kentie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes