[Qt-interest] QScrollArea with QStackedWidget?
Scott Aron Bloom
Scott.Bloom at sabgroup.com
Sun Aug 23 12:50:43 CEST 2009
It will really depend on if you want ALL of your pages to be inside 1
scroll (probably not) or each page to be its own scroll area (my
personal preference)
If it were me...
Each of your "big" widgets, would be added as this...
QStackedWidget * stacked = new ....
QScrollArea * scrollArea = new QScrollArea;
MyBigButtWidget * widget = new ....
scrollArea->setWidget( widget );
stacked->addWidget( scrollArea );
This way, your big widget, can be used outside a scroll area (ie a
dialog) and not have to worry about scroll issues.
Scott
-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Robert Hairgrove
Sent: Sunday, August 23, 2009 3:36 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] QScrollArea with QStackedWidget?
Probably something of a beginner question here, but I can't seem to get
it right.
I have a dialog which has a tree view on the left extending the entire
height of the dialog window. It is in a vertical splitter. On the right
side is a table view on the upper right, and below that a QStackedWidget
with various pages. The table view and QStackedWidget are placed in a
horizontal splitter layout. When the selection in the tree view is
changed, a different page in the stacked widget and table view is
displayed depending on the data.
Some of the pages of the stacked widget contain many child widgets and
these extend beyond the default dimensions of the containing widget. I
would like to enable scrolling for these pages, also so that the user
can enlarge the other views if necessary and still be able to access the
controls in the bottom stacked widget page. I tried adding a Scroll Area
in QtDesigner to the pages of the stacked widget which need to scroll
and moved the child widgets inside of the scroll area. However, when I
preview the form, the scroll bars do not appear in spite of the fact
that they are enabled to appear as needed.
What is the correct way to do this? Do I need to add the QStackedWidget
as a child of the scroll area? What about the layouts?
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list