Results 1 to 6 of 6

Thread: How Could I promote Qt's Drawing performance?

  1. #1
    Join Date
    Sep 2007
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Question How Could I promote Qt's Drawing performance?

    I use Qt3,
    I found that when I draw text on a bid widget(full screen),the performance is so bad,
    drawing text consume more CPU time than drawing line,polygon etc.
    Anybody knows why?
    Any suggestion is appreciated.

    Thanks,

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How Could I promote Qt's Drawing performance?

    Try drawing the text as paths. Add the text to a painter path and draw that path instead.
    Maybe it is drawing text that hard because of glyph complexity. Are you drawing a lot of text?

  3. #3
    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: How Could I promote Qt's Drawing performance?

    @marcel: He's using Qt3. There are no painter paths there.

    @joeshow: Could we see the code of the paint event for the widget?

  4. #4
    Join Date
    Sep 2007
    Posts
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How Could I promote Qt's Drawing performance?

    @wysota: Because my project is somewhat big,so I can't list code clearly.

    let me interpret my work:
    I take a big widget(inherit from QWidget,full screen) as my canvas,
    I draw a lot of object(maybe 400~1000) on it. Every object is composed of multi-lines text(1-6lines),but every line is not more than 20 char.
    I redraw all the object every one second, I found that redrawing is much expensive while redrawing polylines( more than ten thousand points) are much springy.
    Maybe draw text is much complex than polylines?

    My English is poor, so I don't know if I have make myself clear,
    But I'm really looking forword to you smart guys's instruction.
    Best wishes,

  5. #5
    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: How Could I promote Qt's Drawing performance?

    Did you try using the QCanvas approach instead of painting on the widget directly? Also, have you tried optimizing your paint event in any way, for example by redrawing only those parts of the widget that actually changed?

  6. #6
    Join Date
    Sep 2007
    Location
    Sant'Elpidio a Mare, Italy
    Posts
    194
    Thanks
    54
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: How Could I promote Qt's Drawing performance?

    Maybe draw text is much complex than polylines?
    In the past, also using different developing environments, I've seen that very often texts are much more expensive to draw than the polygons, since text has to intermediate with font operations (and font create operations) that are astoundingly heavy jobs.

    Greetings
    --
    raccoon29

    "La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "

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.