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. QGraphicsScene in QGraphics view Scroll bar issues
Forum Updated to NodeBB v4.3 + New Features

QGraphicsScene in QGraphics view Scroll bar issues

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.4k 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.
  • BlackMambaB Offline
    BlackMambaB Offline
    BlackMamba
    wrote on last edited by
    #1

    Hello,

    I have a QGraphicsScene bigger than the QGraphicsView I am setting the scene in.
    So, by default, it adds scroll bars, vertical and horizontal in my case.
    The issue I have is that the scene is centered into the view and the scroll bars initial positions are in the middle on X axis and Y axis.
    I would like that on the X axis, the scroll bar is at the extreme left instead of in the middle. How could I do that?

    Thanks

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      You can use "Scroll":http://qt-project.org/doc/qt-5.0/qtwidgets/qwidget.html#scrollhttp://qt-project.org/doc/qt-5.0/qtwidgets/qwidget.html#scroll function to scroll to desired points, which would be 0 for x position to set scrollbar to extreme left.

      157

      1 Reply Last reply
      0
      • BlackMambaB Offline
        BlackMambaB Offline
        BlackMamba
        wrote on last edited by
        #3

        Thank you it works ! Once thing strange still is that when I do :

        ui->graphicsViewS->horizontalScrollBar()->setSliderPosition(
                    ui->graphicsViewS->horizontalScrollBar()->minimum());
        

        it is also setting the minimum value for the verticalScrollBar ... Any idea why?

        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