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. Disable scrolling in QGraphicsView
Forum Updated to NodeBB v4.3 + New Features

Disable scrolling in QGraphicsView

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 9.0k 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.
  • S Offline
    S Offline
    sleam
    wrote on last edited by
    #1

    Hi, I got an application where I use the mouse wheel to zoom in and out (scale) the contents of the QGraphicsView.
    But when the QGraphicsView's sceneRect is smaller than the scene, I get scrollbars, and the scene is scrolled to the edge before any QWheelEvent's are passed to my QMainWindow.

    How can i solve this?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vsorokin
      wrote on last edited by
      #2

      try add:
      @
      youGraphicsViewObject->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
      youGraphicsViewObject->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
      @

      --
      Vasiliy

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sleam
        wrote on last edited by
        #3

        thank you, but that only makes the scrollbars invisible, the view still scrolls.

        1 Reply Last reply
        0
        • F Offline
          F Offline
          fcrochik
          wrote on last edited by
          #4

          just a guess: isn't it because of the overshoot (I think that is how it is called)?

          Certified Specialist & Qt Ambassador <a href="http://www.crochik.com">Maemo, Meego, Symbian, Playbook, RaspberryPi, Desktop... Qt everywhere!</a>

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sleam
            wrote on last edited by
            #5

            yes, it is because of the overshoot, but I always have overshoot..

            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