Results 1 to 4 of 4

Thread: QGraphicsTextItem speed up creation/rendering process

  1. #1
    Join Date
    Mar 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Question QGraphicsTextItem speed up creation/rendering process

    Hi,
    I want to use QGraphicsTextItem and want to speed up the creation/rendering process in order not to slow down the GUI as much as possible.
    So I am wondering if it is possible to create QTextDocument in a separate thread. This will get the expensive layout operations off the GUI thread. Once QTextDocument is created I was thinking to set it on the QGraphicsTextItem.

    Does anyone have some ideas if that is the right way or how I can achieve to have the rendering for QGraphicsTextItem in a separate thread?

    Thanks for your help.

    M.

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

    Default Re: QGraphicsTextItem speed up creation/rendering process

    I don't think this would work. What do you have in your text item that needs so intensive rendering?
    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
    Mar 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QGraphicsTextItem speed up creation/rendering process

    Can you think of any way how to prevent to slow down the GUI thread when I want to create/render QGraphicsTextItem ?

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

    Default Re: QGraphicsTextItem speed up creation/rendering process

    I can think of many ways to speed up the process but what fits best really depends on what your code does. For example creating the items and adding them to a scene before setting a scene on the view will be faster than setting the scene on the view first and adding items later. You can also add items in bundles (not all at once) allowing the event loop to process pending events in the meantime. There are other things too but without knowing your exact situation it's not possible to suggest anything. And by the way - moving the process to another thread wouldn't help in any way, you'd still have some loop in the GUI that would block event processing.

    Reading this might give you some insights too: http://doc.trolltech.com/qq/qq27-responsive-guis.html
    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. How to speed up a transparent QGraphicsTextItem in Opengl?
    By JohannesMunk in forum Qt Programming
    Replies: 18
    Last Post: 28th October 2009, 10:45
  2. Replies: 11
    Last Post: 2nd July 2009, 00:41
  3. Replies: 6
    Last Post: 8th June 2009, 21:44
  4. QMatrix rotate on QGraphicsTextItem speed on render..
    By patrik08 in forum Qt Programming
    Replies: 2
    Last Post: 22nd December 2007, 19:46
  5. Rendering rectangles speed issue
    By macbeth in forum Qt Programming
    Replies: 11
    Last Post: 15th March 2007, 01:30

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.