[Qt-interest] How to make a dialogue box with scroll bars?
Anton Chernov
mechernov at gmail.com
Wed Mar 23 22:16:47 CET 2011
Very annoying thing - be sure that you have ALWAYS a parent on
whatever widget in the constructor (where it is not explicitly
required). Even with the generated ui files. Check them too. Believe
me - it helps! :)
2011/3/23 Robert Wood <robert.wood at apostrophe.co.uk>:
> 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
>
More information about the Qt-interest-old
mailing list