Expanding issue, QScrollArea



  • Well I am having some trouble with this layout. First here's the code I have:

    @
    QTabWidget* tabWidget; // is initialized else where

    QScrollArea* scroll = new QScrollArea( tabWidget );
    QWidget* scrollWidget = new QWidget();
    QVBoxLayout* layout = new QVBoxLayout(scrollWidget);

    QPushButton* but = new QPushButton("button", scrollWidget);
    layout->addWidget(but);

    scroll->setWidget(scrollWidget);

    tabWidget->addTab(scroll, QString());
    @

    Everything works fine, the scroll area expands with the tab widget when I stretch the window.

    The only problem is that the QVBoxLayout doesn't seem to be expanding to fill the QScrollArea and instead it remains at a fixed size and doesn't expand into the QScrollArea, even though there is room to.



  • @scroll->setWidgetResizable(true);@


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.