A common way for putting a lot of information in a single dialog is using the concept of stacked layouts.
The idea is that we have a number of panels one over the other, each of one carrying some relevant information. Obviously, if don't want the user getting confused and probably angry with us, such information splitting should be done with a clear logic, and should be easy to access to any sub-panel.
To do that is a common pattern using together QListWidget and QStackedWidget.
The list provides a way for selecting a sub-panel, and the stacked widget organizes the stack itself.
It is very easy to manage gtaphically this couple of widgets through Qt Designer. Basically, the point is making a connection between the two widgets using as signal QListWidget::currentRowChanged(int) and as slot QStackedWidget::setCurrentIndex(int). Moreover we just have to set the currentRow for the list to 1, so that we initialize the mapping, and that is it.
Well, actually, we still have to put meaningfull information in the list and the panels, but the structure is there.
If the data you should show to the user is not such a big deal, and you are thinking just of a few tabs, a good alternative is QTabWidget, where we have access to a configurable list of stacked panels accessed by tabs.
I suggest you reading "C++ GUI Programming with Qt 4, Second Edition" by Jasmin Blanchette and Mark Summerfield for more details.
No comments:
Post a Comment