PDA

View Full Version : Tabbed widget performance suggestions



MrGarbage
8th December 2007, 16:02
As I am about to embark on a design change to improve the performance of
my application, I'm interested in opinions on the best way to implement this.

I have a workspace area which contains a tabbed widget.

On each of the tabs there will be a fairly complex dialog.

I initially placed the dialogs on each page as part of the Designer, but
it took forever to startup the app.

Then I changed it such that when a tab was clicked, I would create the dialog.
ie:

m_TypeScrollArea = new QScrollArea;
m_TypeScrollArea->setWidget(m_DPMConfigType);
DPMtabWidget->layout()->addWidget(m_TypeScrollArea);
m_TypeScrollArea->setWidgetResizable(true);

If another tab is clicked, a similar set of code is executed.

If however the original tab is clicked, I do not create a new instance of the
dialog that was created before, I use the existing one. The idea being that I
did not want to again take the time required to create the dialog.

What is somewhat of an issue is the DPMtabWidget layout.
If I add a widget to it, then I must hide that widget when I go to another
property tab.

I had thought that I could perhaps delete the existing widget from the layout
when I go to a new Tab, but I'm not sure there's a way to do that, or if there
is that it's any faster than hiding what's already there.

My experience so far has shown that hide/show is very slow, so I'm thinking there
should be a better way.


How should I implement my tab sheet pages to get the best performance, given that
the dialogs they show can be quite complex?

Thank you as always!