layout

Python: How to unassign Layout from GroupBox in PyQt

Python: How to unassign Layout from GroupBox in PyQt Question: A groupbox: myGroupBox = QtGui.QGroupBox() and two layouts: layoutA = QtGui.QVBoxLayout() layoutB = QtGui.QVBoxLayout() I assign layoutA to myGroupBox: myGroupBox.setLayout(layoutA) Later there is a need to re-assign layoutB to myGroupBox: myGroupBox.setLayout(layoutB) But getting a warning… QWidget::setLayout: Attempting to set QLayout “” on QWidget “”, which …

Total answers: 1

How exactly does addStretch work in QBoxLayout?

How exactly does addStretch work in QBoxLayout? Question: I’m doing a PyQt4 tutorial about box layouts. But I dont understand how addStretch works. If i use vbox.addStretch(1) and hbox.addStretch(1), the two buttons appear down-right. Why? if i comment vbox.addStretch(1) and hbox.addStretch(1) out, the two buttons appear in the center of my window, and they’re deformable …

Total answers: 1

PyQt: How to make widget scrollable

PyQt: How to make widget scrollable Question: I am trying to make my QGroupBox scrollable once it grows higher than 400px. The contents in the QGroupBox are generated using a for-loop. This is an example of how it was done: mygroupbox = QtGui.QGroupBox(‘this is my groupbox’) myform = QtGui.QFormLayout() labellist = [] combolist = [] …

Total answers: 1

Size of figure when using plt.subplots

Size of figure when using plt.subplots Question: I’m having some trouble trying to change the figure size when using plt.subplots. With the following code, I just get the standard size graph with all my subplots bunched in (there’s ~100) and obviously just an extra empty figuresize . I’ve tried using tight_layout, but to no avail. …

Total answers: 1

pyqt designer and layout for central widget

pyqt designer and layout for central widget Question: I started new clear Main Window project, There are 4 Objects: MainWindow, centralWidget, menubar, and statusbar. I need to set default layout inside the window, so probably for centralWidget. But I didnt found way how to do it. I can get LayoutWidget with some particular size into …

Total answers: 2

When to use pack or grid layouts in tkinter?

When to use pack or grid layouts in tkinter? Question: Are there any best practice tips regarding when one should use pack vs. grid for their layouts? From what I’ve been reading via google, the concencus seems to be that grid can handle any pack scenario but not vice-versa. To start the conversation, it appears …

Total answers: 3