[Qt-interest] Qt TabWidget Optimization
Sean Harmer
sean.harmer at maps-technology.com
Thu Jan 29 20:57:49 CET 2009
On Thursday 29 January 2009 05:11:29 Ekta Sarvaiya wrote:
> Hi,
>
> I have a tab-widget and 7 tabs with lots of data and different dialogs
> on it.
> Just now I am working on optimization..
> It takes lot of time to switch from 1 tab to other and for opening other
> child dialogs.
> If u have any idea,please suggest it to me.
First thing to do is to collect some profiling information about what is
causing the app to be slow. Use some strategically placed
QTime::start()/restart()/elapsed() calls or run your app through valgrind.
If creating the widgets on each tab is taking a long time at application
startup, try using deferred initialisation. That is use a QTimer to create the
widgets on the non-visible tabs in the background whilst the user is doing
things on the first tab. Alternatively only create the widgets on the other
tabs when the user switches to that tab.
What sort of architecture are you running on? Does it have a floating point
unit? If not, are you doing lots of floating point calcs using a soft-float
implementation? That will kill perceived performance.
Also, as Tony suggested, try boiling it down to a simple test case to see if
you still get performance problems. Then start adding in your complex widgets
one at a time to see which is causing the problem. You can't optimise until
you know where to optimise.
Good luck,
Sean
More information about the Qt-interest-old
mailing list