Reputation:
Let's say I have 3 toolbars toolBarA, toolBarB and toolBarC. toolbarA and toolBarB are in top row. toolBarC is in the second row. Now I have added toolBarD. It is automatically placed after toolBarC in second row, but I want it to be placed in first row, after toolBarB.
Now, if drag the toolBarD to the desired location in Qt Creator, everything looks fine, but when I run the project, the toolBarD is always placed after toolBarC in the second row.
How to make it stay where I want? I have tried rebuilding whole project but that doesn't change anything.
Here is what it looks like
Upvotes: 1
Views: 2304
Reputation:
It's more like a workaround than a proper solution, but it works.
The order in which toolbars are created makes a difference. Qt Creator will not change the order automatically. To trick Qt Creator that toolBarD was added right after toolBarB and before toolBarC you need to close the Creator and open .ui file inside a text editor and locate following block.
<widget class="QToolBar" name="toolBarD">
...
</widget>
Now you have to cut it and paste it somwhere between block resposible for creation of toolBarB and toolBarD. For example, like this:
<widget class="QToolBar" name="toolBarB">
...
</widget>
<widget class="QToolBar" name="toolBarD">
...
</widget>
<widget class="QToolBar" name="toolBarC">
...
</widget>
Save the file and reopen the project inside Creator. toolBarD should be now placed right after toolBarB.
Upvotes: 2