[Qt-interest] How to make a dialogue box with scroll bars?
Malyushytsky, Alex
alex at wai.com
Thu Mar 24 00:43:30 CET 2011
First of all user will mostly likely find need to scroll to find a button annoying.
So I would recommend to change the design so it does not have hundred of buttons on the single page.
It may be achieved by grouping them using tabwidget or any other alternative.
If this does not work approach with QScrollArea will work.
I recall made it work when I had to place group of large controls (QTableWidget, etc ) on QDockWidget which allowed me not to limit dockwidget resizing.
In case of buttons, it should be simple. Make sure you placed all the buttons in the layout.
This should ensure that the size hint of the child widget is set to a suitable value.
Alex
-----Original Message-----
From: qt-interest-bounces+alex=wai.com at qt.nokia.com [mailto:qt-interest-bounces+alex=wai.com at qt.nokia.com] On Behalf Of Robert Wood
Sent: Wednesday, March 23, 2011 10:37 AM
To: qt-interest at qt.nokia.com
Subject: [Qt-interest] How to make a dialogue box with scroll bars?
I've been playing round for the last several hours trying to get a
dialogue box with lots of large buttons on it so that it has scroll bars
so you can see all the buttons.
There are forty-five of these large buttons so the dialogue will need to
scroll a a long way down for the user to select the appropriate button
at times.
I have tried all sorts of thins like putting all the buttons in a
QScrollArea on Qt Designer, putting the buttons in a QFrame and then
following the Image Viewer Example, but rather than putting the imagine
in a QScrollArea I put the frame in it. (This latter one just makes all
the buttons disappear. I tried it like this in my config_dialogue
constructor (where config_dialogue is my dialogue!).
scrollArea = new QScrollArea;
scrollArea->setBackgroundRole(QPalette::Dark);
scrollArea->setWidget(ui->pictureFrame);
Where pictureFrame is a QFrame on which I place the [large] buttons.
I have seen other suggestions Googling around to do similar things to
the above bit of code, but this just doesn't work.
My gut feeling is that this should be a piece of cake in Designer and I
shouldn't have to write code to do it, but I am stuck. Would be very
grateful for a pointer on how I can do this.
Many thanks. :~)
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest
---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.
“This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you.”
“Please consider our environment before printing this email.”
More information about the Qt-interest-old
mailing list