Results 1 to 5 of 5

Thread: QGraphicsView question

  1. #1
    Join Date
    Apr 2007
    Posts
    117
    Thanks
    84
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default QGraphicsView question

    can QGraphicsView hold several QGraphicsScenes at a time? or it's only true for QGraphicsItems?

  2. #2
    Join Date
    Jul 2007
    Posts
    11
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QGraphicsView question

    QGraphicsView can't hold many QGraphicsScenes simultaneously.

    And QGraphicsItems are related to QGraphicsScene not QGraphicsView.

    The exact scenario is as follows:

    - QGraphicsScene may contains single or multiple graphicsItems.
    - One graphicsview can display only one graphicsscene at a time.

  3. The following user says thank you to a_m_mukul for this useful post:

    sincnarf (4th July 2007)

  4. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QGraphicsView question

    Quote Originally Posted by sincnarf View Post
    can QGraphicsView hold several QGraphicsScenes at a time?
    No, a QGraphicsView represents a single QGraphicsScene. You can adjust QGraphicsItem::zValue() if you want to make layers.
    J-P Nurmi

  5. The following user says thank you to jpn for this useful post:

    sincnarf (4th July 2007)

  6. #4
    Join Date
    Jul 2006
    Posts
    126
    Thanks
    17
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGraphicsView question

    Also, you can have multiples scenes in memory and change them in the GraphicsView

  7. The following user says thank you to xgoan for this useful post:

    sincnarf (4th July 2007)

  8. #5
    Join Date
    Jan 2006
    Location
    Norway
    Posts
    124
    Thanked 38 Times in 30 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Cool Re: QGraphicsView question

    Technically it's possible to write a QGraphicsSceneItem, if you want multiple scenes inside the same view. If you don't mind skipping the scrollbars, you do have everything available in QGraphicsScene's API to make an item:

    QGraphicsItem::boundingRect: returns anything suitable / a subscene rect.
    QGraphicsItem:aint: calls QGraphicsScene::render().

    We actually have a registered suggestion for such an item, and we might provide one for 4.4.
    Bitto / Andreas Aardal Hanssen - andreas dot aardal dot hanssen at nokia
    Nokia Software Manager, Qt Development

  9. The following user says thank you to Bitto for this useful post:

    sincnarf (12th July 2007)

Similar Threads

  1. Speed, transparency, and drop issues with QGraphicsView
    By jefferai in forum Qt Programming
    Replies: 16
    Last Post: 30th June 2007, 16:14
  2. no image displayed on QGraphicsView
    By sincnarf in forum Qt Programming
    Replies: 9
    Last Post: 28th June 2007, 12:33
  3. QGraphicsScene and QGraphicsView
    By rossd in forum Qt Programming
    Replies: 2
    Last Post: 25th April 2007, 14:43
  4. QGraphicsView scale question.
    By hickscorp in forum Qt Programming
    Replies: 20
    Last Post: 15th April 2007, 02:28
  5. Using QGraphicsView with model/view programming
    By JLP in forum Qt Programming
    Replies: 3
    Last Post: 29th January 2007, 11:04

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.