def __init__(self, widget, parent=None): QtWidgets.QDialog.__init__(self, parent) self.setWindowTitle(self.tr("Set Options")) self.setGeometry(300, 300, 200, 200) self.setSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum) self.widget = widget self.previewWidget = StatusLabel() tab = QtWidgets.QTabWidget() self.tab1 = QtWidgets.QWidget() self.tab2 = QtWidgets.QWidget() tab.addTab(self.tab1, 'Actions') self.buildtab1() vbox = QtWidgets.QVBoxLayout() vbox.addWidget(tab) wid = QtWidgets.QWidget() vbox2 = QtWidgets.QVBoxLayout(wid) label = QtWidgets.QLabel('Default Designer Text') self.defaultTextTemplateEditBox = QtWidgets.QLineEdit() self.defaultTextTemplateEditBox.setText(self.widget.text()) vbox2.addWidget(label) vbox2.addWidget(self.defaultTextTemplateEditBox) vbox.addWidget(wid) # Dialog control buttons buttonBox = QtWidgets.QDialogButtonBox() okButton = buttonBox.addButton(buttonBox.Ok) cancelButton = buttonBox.addButton(buttonBox.Cancel) okButton.clicked.connect(self.updateWidget) cancelButton.clicked.connect(self.reject) vbox.addWidget(buttonBox, 1) self.setLayout(vbox)
def createWidget(self, parent): return StatusLabel(parent)