Results 1 to 2 of 2

Thread: Expand QGraphicsScene at runtime

  1. #1
    Join Date
    Apr 2011
    Posts
    7
    Qt products
    Qt Jambi
    Platforms
    Windows

    Default Expand QGraphicsScene at runtime

    Hey Guys,

    Im trying to implement a QGraphicsScene which contains QGraphicsItems.
    Items can be dragged around the scene, however if they are dragged outside the scene, they are currently being clipped. I would like a scroll bar allowing the user to expand to this new area rather than just clipping the items and loosing them off screen.

    I understand that the QGraphicsScene expands to the used space if setSceneRect is not defined or is null.

    However when multiple items are on the boundary of the scene, they start getting pushed to the boundary of the new expanded scene (if that makes sense...). I'm after expandind the scene, but not changing the current position of the items within this scene.

    Are there any samples for expanding QGraphicsScenes available?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Expand QGraphicsScene at runtime

    You can redefine the scene rect manually whenever you want if the default behaviour is not suitable for you.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 1
    Last Post: 25th September 2010, 08:20
  2. Expand and keep ratio
    By nifei in forum Qt Programming
    Replies: 1
    Last Post: 8th September 2009, 16:19
  3. QTreeView expand signals
    By Vidar Bøe in forum Qt Programming
    Replies: 2
    Last Post: 26th May 2008, 09:47
  4. QTreeViews should not expand!
    By zwwe in forum Qt Programming
    Replies: 2
    Last Post: 13th February 2008, 14:52
  5. expand a treeWidget
    By mattia in forum Newbie
    Replies: 6
    Last Post: 6th December 2007, 13:24

Tags for this Thread

Bookmarks

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.