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. Qt Layouts: help needed with widgets that overlap
Forum Updated to NodeBB v4.3 + New Features

Qt Layouts: help needed with widgets that overlap

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 3.7k 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.
  • C Offline
    C Offline
    contradiction_12
    wrote on last edited by
    #1

    Hi there,

    I've spent a few hours on this but I'm still having trouble. I was wondering if there is something I am overlooking, or if it is not possible to do it using Layouts?

    I need to have two widgets diagonal from each other (each is 85x85 on Qt Designer), sort of like two squares of a chess board, except that the top edge of the bottom widget, and the bottom edge of the top widget should touch, and there should be a 47 pixel overlap along the edge. There is no vertical overlap.

    I've tried using spacers and two QHBoxLayouts.. but i'm having trouble getting the exact behaviour I need. Anyone able to point me in the right direction?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dbzhang800
      wrote on last edited by
      #2

      Hi, you can do it manually instead of using QLayout. or you should create a custom QLayout.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        contradiction_12
        wrote on last edited by
        #3

        Thank you for the answer!

        Won't using two fixed size widgets cause the application to have strange behaviour while resizing though?

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dbzhang800
          wrote on last edited by
          #4

          No, you have full control for the sub widgets without QLayout. all the move and resize behavior can be controlled by yourself now.

          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