Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt Layouts: help needed with widgets that overlap



  • 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?



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



  • Thank you for the answer!

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



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


Log in to reply