PDA

View Full Version : Main Window with tabs



eric.frederich
14th September 2010, 19:20
How should I create dock widgets for a MainWindow style application that can handle multiple documents via tabs?

For example, if this was an image editing program and I had a histogram in a dockwidget, how would I get the histogram to always display information associated with the currently selected tab?

Should I have the dock widget be a QStackWidget?
Should I have only a single widget that just updates itself with data from the currently selected widget?
Are there other strategies?

Thanks in advance,
~Eric

Lykurg
14th September 2010, 19:26
I would definitely go for the solution with a single widget. Depending on what is drawn/shown you can consider holding the pure data in background so that it don't has to be calculated each time the tab is changed.