Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. i cannot add a layout to my widget
QtWS25 Last Chance

i cannot add a layout to my widget

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
3 Posts 3 Posters 2.0k Views
  • 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.
  • A Offline
    A Offline
    aftalib
    wrote on last edited by
    #1

    Hello, i'm working on a QDialog and i cannot manage to add a layout to my QWidget. heres a related screenshot : Capture.JPG

    for example when i try to select the tab5 QWidget and try to add a layout vertically, the whole Dialog goes vertical and messes everything up, and the selection goes back to QDialog, which i dont understand why. does anyone know how to solve this ?

    ( i am having a really hard time understanding this layout situation..)

    JonBJ 1 Reply Last reply
    0
    • A aftalib

      Hello, i'm working on a QDialog and i cannot manage to add a layout to my QWidget. heres a related screenshot : Capture.JPG

      for example when i try to select the tab5 QWidget and try to add a layout vertically, the whole Dialog goes vertical and messes everything up, and the selection goes back to QDialog, which i dont understand why. does anyone know how to solve this ?

      ( i am having a really hard time understanding this layout situation..)

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @aftalib said in i cannot add a layout to my widget:

      ( i am having a really hard time understanding this layout situation..)

      I agree! Qt Designer has the really confusing "feature" that you cannot add a layout to any widget unless you add a child widget to it first :( Then you can set the widget's layout. Apparently you can then even delete the child widget and the parent will retain its layout.

      Note that the above applies to setting layout on a widget, which is why your tabs show with the "red no-entry sign" on them, to show they have no layout. I'm not sure how this relates if you are saying you are trying to drag an explicit layout onto a widget, which maybe is what you are saying. But see if what I have written helps.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SimonSchroeder
        wrote on last edited by
        #3

        That part is a little bit confusing. Your QTabWidget will have a currently visible tab. To set the layout of the currently visible tab, you set the layout on tabWidget_2. Switch to the other tabs to set their layouts by also applying the layout to tabWidget_2 again.

        1 Reply Last reply
        2

        • Login

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