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

Investigate wheel events

    XMLWordPrintable

Details

    Description

      • Wheel scroll lines
        • QPlatformTheme::ThemeHint::WheelScrollLines
          • "The number of lines to scroll a widget, when the mouse wheel is rotated. The default value is 3.  \sa QApplication::wheelScrollLines()"
          • Integer, can't do fractional lines
          • "when the mouse wheel is rotated"
            • By how much?
              1. One "click"?
              2. 120 degrees?
              3. A full 360 rotation?
            • Likely based on Windows. Default 3. SPI_GETWHEELSCROLLLINES
              • Windows UI says "choose how many lines to scroll each time", so likely option #1
          • Exposed as QStyleHints::wheelScrollLines and QApplication::wheelScrollLines and overridable via QStyleHints
            • "the number of lines to scroll a widget, when the mouse wheel is rotated."
        • macOS
          • No system setting
          • NSScrollView.horizontalLineScroll
            • Number of pixels to scroll when scrolling line by line
              • Default 10
            • Doesn't say anything about how much to scroll per tick/degree of the wheel
      • Wheel delta
      • QWheelEvent
        • angleDelta
          • "Returns the relative amount that the wheel was rotated, in eighths of a degree. "
          • "Most mouse types work in steps of 15 degrees, in which case the delta value is a multiple of 120; i.e., 120 units * 1/8 = 15 degrees."
            • Qt has standardized on the 15 degrees as being one "click", and that it should map to one increment (line/item)
        • pixelDelta
          • Simple, plain old (QtGui) pixels
          • Should be preferred if !isNull()
            • However the QWheelEvent overview docs say:
              • "pixelDelta() returns the deltas in screen pixels, and is available on platforms that have high-resolution trackpads, such as macOS. If that is the case, device()->type() will return QInputDevice::DeviceType::Touchpad."
                • If we synthesize the pixel deltas, we still want those to be preferred don't we?
                • Does synthesizing the pixel deltas mean we should set source =Qt::MouseEventSynthesizedBySystem ?
                  • The event itself isn't synthesized, just one property of it

      Attachments

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

        Activity

          People

            vestbo Tor Arne Vestbø
            vestbo Tor Arne Vestbø
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes