I am new in Qt (actually PyQt) and still trying to take it step by step
I will make my question clear
I designed a dialog in the designer which looks like this :
NormilizeDialog_question2_start.jpg
In the initialization I added widgets to an empty vertical box layout found in the middle of the window
After I resize it (manually) it looks like this:
NormilizeDialog_question2_end.jpg
The code of the dynamically created widgets is
class NormalizeDialog
(QDialog, Ui_NormalizeDialog
): """description of class"""
def __init__(self, parent, inputMatrix):
self.setupUi(self)
self.inputMatrix = inputMatrix
self.initNormilizeInput()
self.setLayout(self.verticalLayout_2)
self.adjustSize()
def initNormilizeInput(self):
for fieldName in self.inputMatrix[0]:
normalizeInput = NormalizeInput(self, fieldName)
self.verticalLayout.addWidget(normalizeInput)
class NormalizeDialog(QDialog, Ui_NormalizeDialog):
"""description of class"""
def __init__(self, parent, inputMatrix):
QDialog.__init__(self, parent)
self.setupUi(self)
self.inputMatrix = inputMatrix
self.initNormilizeInput()
self.setLayout(self.verticalLayout_2)
self.adjustSize()
def initNormilizeInput(self):
for fieldName in self.inputMatrix[0]:
normalizeInput = NormalizeInput(self, fieldName)
normalizeInput.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Ignored)
self.verticalLayout.addWidget(normalizeInput)
To copy to clipboard, switch view to plain text mode
So what I am looking for is the following functionality:
- Calculate the height of all the widgets
- activate resize with this height
The code used to create the dynamic widgets is
Second request
Where can I learn (video preffered) about size policy ?
Thank,
Ilan
Bookmarks