Qt Creator/Designer problems with Tab Widget
-
Using Qt Creator/Designer (4.8.1, Linux). Trying to put a Tab Widget (
QTabWidget
) on the layout and having problems accessing the individual tabs (QWidgets
).The designer creates hierarchy:
tabWidget (QTabWidget) tab (QWidget) tab_2 (QWidget)
I need each tab to be a
QScrollArea
, which can then have the tabQWidget
s as the widget to scroll.I have spent way too long trying to make the end application work right where we retain the existing hierarchy and start adding the
QScrollArea
s as a child widget (via a layout) of the existing tabQWidget
ones. (Things go wrong with scrolling. I spent a day trying to get it right, I can't carry on like this.).Now, I searched and all the examples of using
QTabWidget
(not designed from Qt Creator, but that's what there is) for scrolling say the hierarchy only should be:tabWidget (QTabWidget) scroll (QScrollArea) tab (QWidget) scroll_2 (QScrollArea) tab_2 (QWidget)
So they make the
QTabWidget
child beQScrollArea
, not plainQWidget
s. I have tried this by "hacking" the final code and that works great for the scrolling, so that's what I'd like to do.But how to achieve it from Designer? I need the Morph into... context menu item for each
QWidget
tab. But when I select the tab (click on label), the context menu only gives me Page 1 of 2 > Delete or Promote to.... No Morph on the tabs, only for the whole tab widget. I cannot make the tabs be selected in the Object inspector by clicking in the main area. I can click on them in Object inspector, but that context menu does not offer Morph. ?If you really want to object to my desire for
QTabWidget > QScrollArea > QWidget
instead ofQTabWidget > QWidget > QLayout > QScrollArea > QWidget
please say so, but as I said I tried that and for whatever reason did not get the scrolling behaviour right.