Results 1 to 5 of 5

Thread: QWidget seems to perform faster than QGraphicsWidget when drawing text, how come?

  1. #1
    Join Date
    May 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Unhappy QWidget seems to perform faster than QGraphicsWidget when drawing text, how come?

    Hi,
    I've tried porting the Flickable embedded demo from using a QWidget to a QGraphicsWidget and Graphics View architecture on Symbian.
    What I did was to have a list widget that contains a layout to which I add a number of small text widgets that act as the list items.What I've noticed is that there is a huge difference between the speed of scrolling with the Flickable example and with my graphics widget implementation. And I can't find the answer to that or how could I improve this to work smoothly on the graphics architecture. I have to mention that the graphics architecture does it's job right of painting only the visible items in the scene. I've also noticed that in landscape mode where I have only 4 widgets visible in the list versus 7 in portrait mode the speed improvement is highly visible so apparently the painting speed is affected by the number of visible widgets in the view. I've also tried using different caching modes for the widgets to improve performance but it seems that they just made it worse. My question is how the same amount of text is drawn so fast in QWidget implementation and so slow in QGraphicsWidget? and what could I do to improve performance?

    P.S. I have to mention I've tried also using QFont::NoAntialising but there was not visible speed improvement in drawing.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWidget seems to perform faster than QGraphicsWidget when drawing text, how come?

    What I did was to have a list widget that contains a layout to which I add a number of small text widgets that act as the list items.
    That itself seems to be bottleneck. One does not usually add many widgets as items to QListWidget

  3. #3
    Join Date
    May 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QWidget seems to perform faster than QGraphicsWidget when drawing text, how come?

    I'm sorry I've not properly explained it, I'm not using a QListWidget but a QGraphicsWidget, that acts like a container for a list of smaller QGraphicsWidgets that are painting text inside. My problem is that event though the graphics architecture calls paint only on visible widgets (around 7) it is very slow so my kinetic animation is very slow (I've noticed that the more text I have in the widgets the slower the painting, I also know that painting text it is slow from gunnar's posts but it's just too slow in my case. I have a similar pure Symbian implementation that is at least five times faster so I know the device is capable just can't find the bottleneck).
    If someone thinks could help by looking at the source code I'll provide that too.

  4. #4
    Join Date
    May 2010
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QWidget seems to perform faster than QGraphicsWidget when drawing text, how come?

    Here is the source code testkinetic..zip.

  5. #5
    Join Date
    Jan 2011
    Location
    R.O.C.
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWidget seems to perform faster than QGraphicsWidget when drawing text, how come?

    maybe your device don't support floating-point arithmetic native...

    QGraphicsView uses floating-point everywhere.

Similar Threads

  1. Replies: 0
    Last Post: 8th July 2009, 12:01
  2. QWidget in QGraphicsScene not drawing
    By stevel in forum Qt Programming
    Replies: 3
    Last Post: 19th September 2008, 20:19
  3. Replies: 8
    Last Post: 20th April 2007, 11:16
  4. Drawing on QWidget - strech & resize
    By kemp in forum Qt Programming
    Replies: 5
    Last Post: 22nd January 2007, 15:39
  5. Replies: 4
    Last Post: 17th January 2006, 18:46

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.