Results 1 to 2 of 2

Thread: QGraphicsView Scrolling

  1. #1
    Join Date
    Dec 2016
    Qt products

    Default QGraphicsView Scrolling

    Hello. I've got a few QGraphicsItems inside a QGraphicsView, which has a QGraphicsScene attached to it.
    When I make the window bigger, all of the QGraphicItems get bigger, but the QGraphicsView object does not grow vertically, which means the QGraphicsItems are cut off at the bottom. When I use the mouse wheel inside the QGraphicsView object, I am able to scroll down and see the bottom of the QGraphicsItem objects. I do set the height of the view to a bigger number programmatically, but this does not change the size of the view. I also set the size of the scene to be bigger, no difference.

    The view object is inside a horizontal layout with a horizontal spacer, and then the whole horizontal layout is in a vertical layout on the form.

    What am I doing wrong?


  2. #2
    Join Date
    Mar 2011
    Hyderabad, India
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    MacOS X Unix/X11 Windows
    Wiki edits

    Default Re: QGraphicsView Scrolling

    Sounds like something wrong with layout configuration.

    What else do you have in vertical Layout ?

    Is the vertical layout on a Widget directly, or is it in another layout, then you should be tweaking that layout.
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

Similar Threads

  1. QGraphicsView and Scrolling
    By validator in forum Qt Programming
    Replies: 5
    Last Post: 8th September 2017, 00:27
  2. Scrolling QGraphicsView and QGraphicsScene
    By freely in forum Qt Programming
    Replies: 5
    Last Post: 19th February 2013, 13:37
  3. QGraphicsView and QTreeView synchronous scrolling
    By freely in forum Qt Programming
    Replies: 4
    Last Post: 16th January 2013, 12:14
  4. Custom scrolling of QGraphicsView
    By hb in forum Qt Programming
    Replies: 0
    Last Post: 12th August 2008, 10:10
  5. QGraphicsView scrolling problem with 4.3.0
    By hb in forum Qt Programming
    Replies: 8
    Last Post: 30th August 2007, 22:18


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.