Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Overlapping layouts
Forum Updated to NodeBB v4.3 + New Features

Overlapping layouts

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 3 Posters 545 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.
  • B Offline
    B Offline
    BGrimaud
    wrote on last edited by
    #1

    Hi,

    I initially designed my UI in Qt Creator without any layouts, but soon ran into some issues.

    I then redesigned it using layouts, which worked for the most part even though it is a bit less flexible.

    One thing that still bothers me is that I could nicely fit the tabs of my tab widget just below my file dialog to save some space.

    However, now that everything is contained in layouts, this isn't possible anymore.

    Is there anyway to make two layouts overlap somehow ?

    I also tried to move the widget up at runtime, but for some reason I cannot access the absolute widget position displayed in Qt Creator.

    Here's the picture, ideally I would like the top of the babs to be aligned with the top of the open file dialog.

    Capture d’écran du 2023-10-06 13-12-33b.jpg

    Thanks !

    JonBJ 1 Reply Last reply
    0
    • B BGrimaud

      Hi,

      I initially designed my UI in Qt Creator without any layouts, but soon ran into some issues.

      I then redesigned it using layouts, which worked for the most part even though it is a bit less flexible.

      One thing that still bothers me is that I could nicely fit the tabs of my tab widget just below my file dialog to save some space.

      However, now that everything is contained in layouts, this isn't possible anymore.

      Is there anyway to make two layouts overlap somehow ?

      I also tried to move the widget up at runtime, but for some reason I cannot access the absolute widget position displayed in Qt Creator.

      Here's the picture, ideally I would like the top of the babs to be aligned with the top of the open file dialog.

      Capture d’écran du 2023-10-06 13-12-33b.jpg

      Thanks !

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

      @BGrimaud
      Layouts (and possibly widgets) have margins (also spacing), if those are not empty (by default) that could cause extra spacing. In principle I would expect you be able to get things as close as possible if that is what you want.

      You cannot (so far as know) "overlap" layouts, not should you want to.

      If you are running the PyQt/PySide uic on your .ui files (as opposed to loadUi() at runtime) that produces a .py file from the .ui file. There you can see the Python code generated from the .ui.

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

        You also have to apply a layout to the whole outer widget. Otherwise you'll have free-floating layouts which is the same thing as before. Some goes for the individual tab pages. These also need a layout assigned (and not just a layout living inside of them). Assigning to tab pages is a little bit more complicated. You need to select each tab page after another and assign a layout to the tab widget (i.e. the widget the pages live in). This will assign the layout to the current page and not the tab widget. Trying to assign the layout to the page widget directly will fail.

        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