Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Expanding issue, QScrollArea
Qt 6.11 is out! See what's new in the release blog

Expanding issue, QScrollArea

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 5.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    exiled
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • R Offline
      R Offline
      RazrFalcon
      wrote on last edited by
      #2

      @scroll->setWidgetResizable(true);@

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved