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

Keeping the test QTDesigner layout



  • I have a test task of switching the form widgets around - move the highlighted as second - after the one which is not highlighted in this simple example - just swap them around. .
    So I break the layout and can move them around.

    That works fine, however , it breaks the layout and some other widgets - at random.
    ( see the horizontal break - it now in wrong place )

    Restoring the layout to "grid " or "form" creates undesirable layout.

    What can fo to I keep the old layout and do this simple ( test) modification - ALL in GUI - using QTDesigner ?

    I prefer not to mess with layout (ui) code .

    a1b67bb4-fe30-4542-98b9-040fdf7a1651-image.png

    This is the result of resizing / moving the widgets
    I did not restore the layout

    ca559f1b-43f3-4dd3-8b25-011314f295a4-image.png



  • @AnneRanch said in Keeping the test QTDesigner layout:

    just swap them around. .
    So I break the layout and can move them around.

    It is not clear why you need to do any "layout breaking" to move items around. Usually one just drags widgets around on the current layout. For example, if the layout you show is a QVBoxLayout (or for that matter a QGridLayout or QFormLayout) there is no reason why you cannot reorder the widgets on it without having to break and recreate the layout.



  • @JonB From my experience I cannot modify the layout until I "break layout".



  • @AnneRanch

    You can always put widgets in or take them out without breaking it. To modify/replace the layout itself, you need to break it in order to "free" the content and place a new layout to put the stuff in again.



  • @AnneRanch said in Keeping the test QTDesigner layout:

    @JonB From my experience I cannot modify the layout until I "break layout".

    I don't know what to say. You can drag existing widgets from one place on a layout to another place on the same or another layout. You do not need to Break Layout for that purpose.



  • @Pl45m4 Yes, I can add "stuff" into the form, but moving existing widget is a challenge. I am getting some help with blue line and red rectangle- it is dynamic - changes with moving the add around.
    I am going to see if there is a documentation on that .



  • @AnneRanch

    Drag and drop is nothing special... why you need a documentation for that? Do you need a documentation how to click with your mouse as well? I don't think so.

    The blue line indicates where you can drop/move the dragged widget. It's indeed a little tricky to hit the right spot where to drop the widget, but it works like it should.


Log in to reply