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

QApplication::wheelScrollLines() should respect OS settings

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Closed
    • Priority: P4: Low
    • Resolution: Done
    • Affects Version/s: 5.5.1
    • Fix Version/s: None
    • Component/s: Core: Plugins
    • Labels:
      None
    • Commits:
      Windows: 10bea194f873eedda312dd958fb8696e5ad2bb1b (qtbase/5.6, 23.11.2015, 5.6)

      Description

      Currently QApplication::wheelScrollLines() has a fixed default of 3. It would be more natural if the default would be taken from the OS.

      Solution:

      Im not too much into the internals of Qt, so I may be wrong at some point. But this is how I would do it:

      • Add WheelScrollLines to QPlatformIntegration::StyleHint.
      • As a fallback, the default value returned by QPlatformIntegration::StyleHint(QPlatformIntegration::WheelScrollLines) would still be 3.
      • Subclasses for the different OSs can override this. For example, QWindowsIntegration would handle this completely analogous to KeyboardAutoRepeatRate. The corresponding OS call is just SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &lines, 0).
      • QApplication::set/wheelScrollLines() has to persist (i.e. overwrite default settings) to maintain backward compatibility. By convention, one could use a special value of 0 or -1 to mark "Use platform settings". I.e. QApplicationPrivate::wheel_scroll_lines would default to this value and it would be allowed as an argument in QApplication::setWheelScrollLines(). QApplication::wheelScrollLines() would replace this value by the one obtained from the StyleHint, and simply pass on values > 0.

      In my eyes, this is a straight forward and extension of the current behavior.

      I've never committed code to Qt so far, therefore I've just outlined what to do. Would the chance of integration be much better if I send a patch/pull request? If so, can you please point me to a description how to do it? Thanks.

        Attachments

        1. qtbug49561_repro.diff
          1 kB
          Friedemann Kleint
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            sorvig Morten Sørvig
            Reporter:
            thoffmann Tim Hoffmann
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes