PDA

View Full Version : multiple stackedWidgets



sacrif
25th January 2010, 21:13
Hi,

until now I had a stackedWidget which shows a plot on each "page". But now I have several series of plots.
So I would like to create some kind of 2 dimensional stackwidget, where I can choose the series first from a compobox and then click (like i do it now for only one series) through the plots of the series choosen due to the combobox.

At the moment my only solution is to put alle series on one stackedwidget and remember the index where a new series starts. But if there is one I would prefere a more convenient solution.

Regards scr

Lykurg
25th January 2010, 22:04
Maybe I don't understand your problem, but since QStackedWidget is a normal widget you can put one into an other. E.g.:

QStackedWidget *gloabl = new QStackedWidget;

QStackedWidget *sub1 = new QStackedWidget;
QWidget *subplot_1_1 = new QWidget;
QWidget *subplot_1_2 = new QWidget;
sub1->addWidget(subplot_1_1);
sub1->addWidget(subplot_1_2);

QStackedWidget *sub2 = new QStackedWidget;
QWidget *subplot_2_1 = new QWidget;
QWidget *subplot_2_2 = new QWidget;
sub2->addWidget(subplot_2_1);
sub2->addWidget(subplot_2_2);

gloabl->addWidget(sub1);
gloabl->addWidget(sub2);

All that can be created dynamically of course...

sacrif
27th January 2010, 14:14
Thanks a lot! - problem solved! I had another mistake - so that didnt work when I tried first!