The widgets in one QTabWidget tab gets offset from the widgets in the other tab
-
I am attempting to make a panel where information is shown and able to be edited. I do this by having a QTabWidget with two tabs: one for displaying and one for editing. I would like the widgets in the edit tab to line up nicely with the widgets in the display tab.
Here is a GIF showing me switching between the two tabs in QT Designer:
https://i.imgur.com/27IUn2X.gifv
As you can see, they line up nicely enough. However, as you can see in this GIF showing me switching between the two tabs in the compiled program, something causes the widgets in the edit tab to move up and slightly to the left:
https://i.imgur.com/9r7T4xN.gifv
The layout items on the bottom half seem to have a lot more room than the layout items on the bottom half.
No spacers or layouts should have different values between the two tabs, on top of which it seems the QT Creator is doing something differently to the compiled program. I really have no idea what could be causing this.
Any help in solving this issue or getting me on track to a better solution for having widgets overlayed in a manner described in the first paragraph would be much appreciated.
Thank you!
EDIT:
I still don't know what caused the bug, but if anyone else is reading this, having run into a similar issue: I "fixed" it by remaking the whole thing step by step, trying to figure out which step of the caused the bug. During my remaking of the panel I figured a QStackedWidget worked better for what I was trying to achieve and so I went with that instead. It currently runs fine with no trace of the issue plaguing the QTabWidget.
I recommend remaking it step by step for further debugging.
-
I am attempting to make a panel where information is shown and able to be edited. I do this by having a QTabWidget with two tabs: one for displaying and one for editing. I would like the widgets in the edit tab to line up nicely with the widgets in the display tab.
Here is a GIF showing me switching between the two tabs in QT Designer:
https://i.imgur.com/27IUn2X.gifv
As you can see, they line up nicely enough. However, as you can see in this GIF showing me switching between the two tabs in the compiled program, something causes the widgets in the edit tab to move up and slightly to the left:
https://i.imgur.com/9r7T4xN.gifv
The layout items on the bottom half seem to have a lot more room than the layout items on the bottom half.
No spacers or layouts should have different values between the two tabs, on top of which it seems the QT Creator is doing something differently to the compiled program. I really have no idea what could be causing this.
Any help in solving this issue or getting me on track to a better solution for having widgets overlayed in a manner described in the first paragraph would be much appreciated.
Thank you!
EDIT:
I still don't know what caused the bug, but if anyone else is reading this, having run into a similar issue: I "fixed" it by remaking the whole thing step by step, trying to figure out which step of the caused the bug. During my remaking of the panel I figured a QStackedWidget worked better for what I was trying to achieve and so I went with that instead. It currently runs fine with no trace of the issue plaguing the QTabWidget.
I recommend remaking it step by step for further debugging.
-
That could be the case.
Here's the display tab:
UI: https://i.imgur.com/rM7BQ6L.png
Tree: https://i.imgur.com/58ieTST.png
Button Layout Settings: https://i.imgur.com/lw4APWZ.png
Button Settings: https://i.imgur.com/xvlT4iE.png...and the edit tab:
UI: https://i.imgur.com/GorC22b.png
Tree: https://i.imgur.com/TOp5v5M.png
Button Layout Settings: https://i.imgur.com/tF0XO1P.png
Button Settings: https://i.imgur.com/oQRQ0sL.png
Button Spacer Settings: https://i.imgur.com/CjVTl5G.pngThank you!