Форум сайта python.su
Имеется код на PyQt
textEdit = QtGui.QTextEdit()
comboSources = self.getSources()
comboModule = self.getModules()
comboPartitions = self.getPartitions()
comboType = self.getTypes()
filds = QtGui.QStackedWidget()
firstFilds = QtGui.QWidget()
layout1 = QtGui.QGridLayout()
layout1.addWidget(varchar20,0,0)
layout1.addWidget(QtGui.QLabel('Name'),0,1)
layout1.addWidget(textEdit,1,0)
layout1.addWidget(QtGui.QLabel('Description'),1,1)
layout1.addWidget(textEdit,2,0)
layout1.addWidget(QtGui.QLabel('Code'),2,1)
layout1.addWidget(comboModule,3,0)
layout1.addWidget(QtGui.QLabel('Module'),3,1)
layout1.addWidget(comboSources,4,0)
layout1.addWidget(QtGui.QLabel('Source'),4,1)
firstFilds.setLayout(layout1)
secondFilds = QtGui.QWidget()
layout1 = QtGui.QGridLayout()
layout1.addWidget(varchar40,0,0)
layout1.addWidget(QtGui.QLabel('Name'),0,1)
layout1.addWidget(varchar40,1,0)
layout1.addWidget(QtGui.QLabel('Description'),1,1)
layout1.addWidget(comboType,2,0)
layout1.addWidget(QtGui.QLabel('Type'),2,1)
layout1.addWidget(varchar40,3,0)
layout1.addWidget(QtGui.QLabel('Address'),3,1)
secondFilds.setLayout(layout1)
thirdFilds = QtGui.QWidget()
layout1 = QtGui.QGridLayout()
layout1.addWidget(varchar20,0,0)
layout1.addWidget(QtGui.QLabel('Name'),0,1)
layout1.addWidget(textEdit,1,0)
layout1.addWidget(QtGui.QLabel('Description'),1,1)
layout1.addWidget(comboPartitions,2,0)
layout1.addWidget(QtGui.QLabel('Partition'),2,1)
thirdFilds.setLayout(layout1)
filds.addWidget(firstFilds)
filds.addWidget(secondFilds)
filds.addWidget(thirdFilds)
tables = QtGui.QComboBox()
tables.addItem('Examples')
tables.addItem('Sources')
tables.addItem('Modules')
filds = self.createFilds()
tables.currentIndexChanged.connect(filds.setCurrentIndex)
gb = QtGui.QWidget()
layout1=QtGui.QGridLayout()
layout1.addWidget(okButton,6,1)
layout1.addWidget(cancelButton,6,2)
layout1.addWidget(tables,6,0)
layout1.addWidget(filds,0,6,6,2)
gb.setLayout(layout1)
self.setCentralWidget(gb)
Офлайн