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. QWheelEvent::orientation() replaced with angleDelta()?
Forum Updated to NodeBB v4.3 + New Features

QWheelEvent::orientation() replaced with angleDelta()?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 4.3k Views 2 Watching
  • 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.
  • S Offline
    S Offline
    stephenju
    wrote on last edited by
    #1

    http://doc.qt.io/qt-5/qwheelevent-obsolete.html#orientation says to replace orientation() with angleDelat().

    But the 2 functions are for different things. orientation() returns what direction the scroll wheel is rotated in. For example on a mouse with tilting wheel, it returns horizontal when the wheel is tilted instead of rolled.

    angleDelta() returns the angle the wheel has been rolled. Like is rolled for a whole circle.

    I really don't see how one can replace the other. Am I missing something?

    1 Reply Last reply
    0
    • Chris KawaC Online
      Chris KawaC Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      angleDelta() returns a QPoint. The x part of the point indicates the horizontal angle and y vertical.
      So if you want to tell the orientation check which of these is non-zero.

      S 1 Reply Last reply
      1
      • Chris KawaC Chris Kawa

        angleDelta() returns a QPoint. The x part of the point indicates the horizontal angle and y vertical.
        So if you want to tell the orientation check which of these is non-zero.

        S Offline
        S Offline
        stephenju
        wrote on last edited by
        #3

        @Chris-Kawa
        Ah. I see. Thanks for the explanation. It makes sense now.

        1 Reply Last reply
        0

        • Login

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