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. GraphicsView, GraphicsItem Wheel Event..
Qt 6.11 is out! See what's new in the release blog

GraphicsView, GraphicsItem Wheel Event..

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 628 Views 1 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.
  • P Offline
    P Offline
    Pada_
    wrote on last edited by
    #1

    I want to zoom in and zoom out the screen with the mouse wheel. And if the mouse hovers over a scrolling item, I want to move the item's scroll, not the View zoom. How do I do this?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Asperamanca
      wrote on last edited by
      #2

      You reimplement QGraphicsItem::wheelEvent on those items that should react to the mouse wheel. Set the event to "accepted" if you handled it.
      Then you reimplement QWidget::wheelEvent on the QGraphicsView, and handle zooming. Look e.g. at the Elasic Nodes example for this.

      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