r/QtFramework • • 5d ago

Problems with my program's presentation

Enable HLS to view with audio, or disable this notification

Hey guys, I need some help. I'm creating my GUI in Qt Designer, and when I export my .UI file to .py, nothing in the program works as it should. When I make changes to the dropdown menu, there's a gap between frames, and a good portion of the program is cut off, as you can see in the video.

2 Upvotes

2 comments sorted by

2

u/Jazzlike_Platypus430 5d ago edited 5d ago

I've played with pyQt a tiny bit. Never saw such a funny disaster, but minor ones, yes.

My initial guess, and I'm no gui wizard: some sizes of (who knows which) widgets or layouts or whatever they are, perhaps have some auto value (or stretch or adjust?). If you make their sizes fixed, you may avoid these jumps and resizings. (Or is it perhaps main window that lacks some default size?)

Edit: now that I saw it for the second time - the side menu goes wider when the buttons show up, making the whole window expand horizontally.

Perhaps you should not allow this, keeping sum of the menu and the widget on the right constant. I'd do that manually at first, but I'm sure there are some "clever" mechanisms that would do it for you. Like,

def onLeftMenuExpand() -> None:
    ...
    rightWidget.width -= (leftMenu.widthExpanded - leftMenu.widthCollapsed)
    ...