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,
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,
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?
@marcel: He's using Qt3. There are no painter paths there.
@joeshow: Could we see the code of the paint event for the widget?
@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,
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?
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.Maybe draw text is much complex than polylines?
Greetings
--
raccoon29
"La mia vita finirà quando non vedrò più la gente ridere...non necessariamente alle mie battute "
Bookmarks