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. Overlapping widgets
Qt 6.11 is out! See what's new in the release blog

Overlapping widgets

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 591 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.
  • ivanicyI Offline
    ivanicyI Offline
    ivanicy
    wrote on last edited by
    #1

    Hello! I am trying to overlap some widgets in a dialog. This is my current structure:

    f0d1c1a7-ed10-4d32-afda-badf9959f82e-image.png

    The blue square is the dialog and the red squares are the layouts.

    The large layout will contain a QGraphicsView and I want to overlap the right layouts on it with the aim that the widgets in the small layouts are on top of it.

    41a526d8-32da-4a0c-9063-fae565fdb351-image.png

    How can I do it?

    Thank you very much!

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      You can use QStackedLayout (or QStackedWidget) and set stackingMode to StackAll.

      (Z(:^

      1 Reply Last reply
      2
      • ivanicyI Offline
        ivanicyI Offline
        ivanicy
        wrote on last edited by ivanicy
        #3

        I was trying it but I don't know how to do it. Could you help me? I tryied using QStackedWidget.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Looking at the docs, I don't see stackingMode property in QStackedWidget. So, use a layout instead.

          Put the stacked layout in your UI first, then add your big layout, and then the row layout with your small items. You'll need to throw a spacer or dummy layout item into that row layout to keep the big space on the left clean.

          (Z(:^

          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