Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    [SOLVED] Scrollarea doesn't show scrollbars and doesn't grow with

    General and Desktop
    1
    2
    632
    Loading More Posts
    • 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.
    • H
      heiopei last edited by

      Hey,

      I want to show my own QWidget, created by QtDesigner in my MainWindow also created by QtDesigner. The MainWindow got a scrollarea with a scrollAreaWidgetContents layout. So, my scrollarea should display several instance of my own QWidget in it. The problem now is that my QWidgets are displayed but overlap eachother and the scrollarea doesn't show the scrollbars and doesn't grow with. I hope you can unterstand my problem and I know my english isn't the best :(.

      Here is my code:
      @ //instance 1 of QWidget
      ab = new ablauf();
      //instance 2 of QWidget
      auto *ab2 = new ablauf();

      //add QWidget to Scrollarea layout
      ui->scrollAreaWidgetContents->layout()->addWidget(ab);
      ui->scrollAreaWidgetContents->layout()->addWidget(ab2);
      
      //set some props
      ui->scrollArea->setWidgetResizable(true);
      

      --@

      1 Reply Last reply Reply Quote 0
      • H
        heiopei last edited by

        Okay, I just changed the layout from the scrollarea. Now it's working.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post