How to display the scrollbars of a DzScrollArea?
Hello, I'm finishing a small GUI, which at the end is finally not "that" small, and I wanted to place all my widgets in a DzScrollArea. From what I understood, it should give me access to a scroll area with scrollbars in which I can add my widgets.
But for now, I don't manage to see the scrollbars at all. I see a "place" for the scrollbars to be included, but they are not here. Here is the short example showing typically what I am writing. Maybe there is an error in my interpretation of how if should behave, but in all of what I tested (DzDialog instead of DzBasicDialog, layouts/no layouts, place widgets in Groupboxes, place group boxes in layouts or not.. or the contrary), I never saw any scrollbars appearing. I've just spent the 10 last hours searching for the scrollbars, I learnt nothing more having a look at QScrollArea docs, so maybe there is something I completely understand, or do, the wrong way. I took the example of a huge test text around which I would like to place a scrollArea.
var wDlg = new DzBasicDialog();//wDlg.sizeGripEnabled = true;wDlg.setMaxHeight = 200;wDlg.setMaxWidth = 200;var fonts = new Font;fonts.pixelSize = 250; var wScr = new DzScrollArea (wDlg); // //wScr.setFixedWidth(500)wScr.setVerticalScrollbarDisplay(true);wScr.setHorizontalScrollbarDisplay(true);wScr.alignment = wDlg.AlignVCenter;wScr.show(); var wtextBox = new DzLabel (wScr);wtextBox.wordWrap = true;wtextBox.text = "Where are the scroll bars????"wtextBox.font = fonts;wDlg.addWidget(wScr)wDlg.exec()[Click and drag to move]
Does anybody have an idea how to have a scroll area with scrollbars around widgets ?
Well thanks in advance for any help. I'm going to bed right now, may things will be more clear tomorrow!
Comments
Just one line missing:
Thank you so much Jag11! I did not know at all what the "setWidget" was here for initially... And of course, it was a key function of all this!
I modified my GUI script this morning to put all my widgets in a main widget relying on the scrollArea. And thanks to your help my interface now works wonderfully even for small screens with bad resolutions!
Thanks again, I can go on with the rest my job now this is solved!
I'm glad.