Results 1 to 6 of 6

Thread: best way to add widget to QGraphicsView

  1. #1
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default best way to add widget to QGraphicsView

    hi,
    Im having a opengl viewport QGraphicsView which dynamically load a image and a check box pair in its scene .
    I made a QGraphicsPixmapItem and adding it to a QGraphicsLinearlayout
    in QGraphicsPixmapItem im able to optimize the cache to load 1000 pixmap at a time.

    now i need a QGraphicsProxyWidget to be optimize so i can render 1000 QCheckBox fast as i can along with the pixmap item..
    I need suggestion from some experts

    i m following the thread
    http://www.qtcentre.org/threads/3798...QGraphicsScene
    "Behind every great fortune lies a crime" - Balzac

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

    Default Re: best way to add widget to QGraphicsView

    What kind of suggestions?
    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.


  3. #3
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: best way to add widget to QGraphicsView

    first thanks for the reply
    similar like how u gave
    I can suggest a couple of things to try:
    1. enable caching for items (as suggested by my preposter but with ItemCoordinateCache)
    2. set ItemHasNoContents flag on all items that paint nothing
    3. set "interactive" property of the view to false if you don't need your scene to be clickable
    4. make shapes as simple as you can, if you scale use the level of detail information to avoid painting things that can't be noticed by the user
    5. make use of drawBackground() and drawForeground() instead of having items that cover the whole scene
    6. avoid clipping
    7. try using the raster engine instead of OpenGL.
    is there any specific things for QGraphicsProxyWidget ..?
    "Behind every great fortune lies a crime" - Balzac

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

    Default Re: best way to add widget to QGraphicsView

    There is one -- don't use QGraphicsProxyWidget.
    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.


  5. #5
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: best way to add widget to QGraphicsView

    Quote Originally Posted by wysota View Post
    but how i can add a QCheckBox to the scene ..?
    "Behind every great fortune lies a crime" - Balzac

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

    Default Re: best way to add widget to QGraphicsView

    Either draw the checkbox yourself using QStyle or replace the checkbox with something else.
    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.


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

    wagmare (25th September 2013)

Similar Threads

  1. integrate widget into QGraphicsView
    By Alvim in forum Newbie
    Replies: 0
    Last Post: 10th May 2010, 18:16
  2. Creating semitransparent widget over QGraphicsView
    By Luc4 in forum Qt Programming
    Replies: 2
    Last Post: 24th March 2010, 10:06
  3. How to Transparent QGraphicsView widget Background?
    By ashukla in forum Qt Programming
    Replies: 31
    Last Post: 6th March 2010, 11:35
  4. Creating a widget on a QGraphicsView
    By maverick_pol in forum Qt Programming
    Replies: 4
    Last Post: 9th August 2007, 17:54
  5. widget qgraphicsview scaling
    By mistertoony in forum Qt Programming
    Replies: 10
    Last Post: 20th March 2007, 22:46

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
  •  
Qt is a trademark of The Qt Company.