Mar-23-2020, 01:51 AM
Sorry about the error. I don't have pandas and I was winging it. I also don't use QMainWindow all that much. Your were correct to create a widget and assign it as the central widget.
The layout widgets do their best to adjust widget sizes to fill the available space. The only time widgets get squeezed out is when widgets are crushed down to their minimum size and the window is shrunk even further. Normally that's not even possible because the layout tells the desktop manager what the minimum size is for the window.
The window manager adjusts widget sizes based on size hints set for the widget and by the stretch factors set in the layout. You should start by just adding all your widgets to layout managers and seeing what the results look like. I usually start with a vertical box layout and then add rows. A row can be a single widget, or I can create a horizontal box layout to have multiple widgets oriented horizontally. There is also a grid layout if your layout follows a grid pattern. Start playing with these to learn how they work and then you can start thinking about tweaking things. For example, you can set a minimum and/or maximum size of a widget in a layout and the layouts will adjust. You can set different stretch factors for different widgets, so they don't grow or shrink at the same rate.
The layout widgets do their best to adjust widget sizes to fill the available space. The only time widgets get squeezed out is when widgets are crushed down to their minimum size and the window is shrunk even further. Normally that's not even possible because the layout tells the desktop manager what the minimum size is for the window.
The window manager adjusts widget sizes based on size hints set for the widget and by the stretch factors set in the layout. You should start by just adding all your widgets to layout managers and seeing what the results look like. I usually start with a vertical box layout and then add rows. A row can be a single widget, or I can create a horizontal box layout to have multiple widgets oriented horizontally. There is also a grid layout if your layout follows a grid pattern. Start playing with these to learn how they work and then you can start thinking about tweaking things. For example, you can set a minimum and/or maximum size of a widget in a layout and the layouts will adjust. You can set different stretch factors for different widgets, so they don't grow or shrink at the same rate.