我们从Python开源项目中,提取了以下15个代码示例,用于说明如何使用PySide.QtGui.QDialogButtonBox()。
def __init__(self, parent=None): QtGui.QDialog.__init__(self, parent) self.setWindowTitle(u'Add new category') # self.categoryName = QtGui.QLineEdit('') self.categoryName.setStyleSheet('background-color:#FFF;') self.categoryDescription = QtGui.QTextEdit('') # buttons buttons = QtGui.QDialogButtonBox() buttons.setOrientation(QtCore.Qt.Vertical) buttons.addButton("Cancel", QtGui.QDialogButtonBox.RejectRole) buttons.addButton("Add", QtGui.QDialogButtonBox.AcceptRole) self.connect(buttons, QtCore.SIGNAL("accepted()"), self, QtCore.SLOT("accept()")) self.connect(buttons, QtCore.SIGNAL("rejected()"), self, QtCore.SLOT("reject()")) # lay = QtGui.QGridLayout(self) lay.addWidget(QtGui.QLabel(u'Name'), 0, 0, 1, 1) lay.addWidget(self.categoryName, 0, 1, 1, 1) lay.addWidget(QtGui.QLabel(u'Desctiption'), 1, 0, 1, 1, QtCore.Qt.AlignTop) lay.addWidget(self.categoryDescription, 1, 1, 1, 1) lay.addWidget(buttons, 0, 2, 2, 1, QtCore.Qt.AlignCenter) lay.setRowStretch(1, 10)
def __init__(self, model, paths, parent=None): QtGui.QDialog.__init__(self, parent) self.setWindowTitle(u'Choose model') # self.modelsList = QtGui.QListWidget() for i in paths: self.modelsList.addItem(i) self.modelsList.setCurrentRow(0) # buttons = QtGui.QDialogButtonBox() buttons.setOrientation(QtCore.Qt.Vertical) buttons.addButton("Cancel", QtGui.QDialogButtonBox.RejectRole) buttons.addButton("Choose", QtGui.QDialogButtonBox.AcceptRole) self.connect(buttons, QtCore.SIGNAL("accepted()"), self, QtCore.SLOT("accept()")) self.connect(buttons, QtCore.SIGNAL("rejected()"), self, QtCore.SLOT("reject()")) # lay = QtGui.QGridLayout(self) lay.addWidget(QtGui.QLabel(u"Choose one of available models for part"), 0, 0, 1, 1) lay.addWidget(QtGui.QLabel(u"<div style='font-weight:bold;'>{0}</div>".format(model)), 1, 0, 1, 1, QtCore.Qt.AlignHCenter) lay.addWidget(self.modelsList, 2, 0, 1, 1) lay.addWidget(buttons, 2, 1, 1, 1)
def __init__(self): super(SettingsDialog, self).__init__() vl = QtGui.QVBoxLayout() self.layout = QtGui.QFormLayout() self.setLayout(vl) vl.addLayout(self.layout) bb = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel) vl.addWidget(bb) bb.accepted.connect(self.accept) bb.rejected.connect(self.reject) self.__saved_pos = QtGui.QCursor.pos()
def __init__(self): super(MultiAutoSettingsDialog, self).__init__() vl = QtGui.QVBoxLayout() self.setLayout(vl) self.headerWidget = QtGui.QWidget() vl.addWidget(self.headerWidget) self.__qsw = QtGui.QStackedLayout() self.__autoWidgets = [] vl.addLayout(self.__qsw) bb = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel) vl.addWidget(bb) bb.accepted.connect(self.accept) bb.rejected.connect(self.reject) self.__saved_pos = QtGui.QCursor.pos()
def __init__(self, categoryID, parent=None): QtGui.QDialog.__init__(self, parent) self.setWindowTitle(u'Update category') self.categoryID = categoryID categoryData = readCategories()[self.categoryID] # self.categoryName = QtGui.QLineEdit('') self.categoryName.setStyleSheet('background-color:#FFF;') self.categoryName.setText(categoryData[0]) self.categoryDescription = QtGui.QTextEdit('') self.categoryDescription.setText(categoryData[1]) # buttons buttons = QtGui.QDialogButtonBox() buttons.setOrientation(QtCore.Qt.Vertical) buttons.addButton("Cancel", QtGui.QDialogButtonBox.RejectRole) buttons.addButton("Update", QtGui.QDialogButtonBox.AcceptRole) self.connect(buttons, QtCore.SIGNAL("accepted()"), self, QtCore.SLOT("accept()")) self.connect(buttons, QtCore.SIGNAL("rejected()"), self, QtCore.SLOT("reject()")) # lay = QtGui.QGridLayout(self) lay.addWidget(QtGui.QLabel(u'Name'), 0, 0, 1, 1) lay.addWidget(self.categoryName, 0, 1, 1, 1) lay.addWidget(QtGui.QLabel(u'Desctiption'), 1, 0, 1, 1, QtCore.Qt.AlignTop) lay.addWidget(self.categoryDescription, 1, 1, 1, 1) lay.addWidget(buttons, 0, 2, 2, 1, QtCore.Qt.AlignCenter) lay.setRowStretch(1, 10)
def __init__(self, parent=None): QtGui.QDialog.__init__(self, parent) self.setWindowTitle("Convert old database to a new format") self.setMinimumWidth(500) # stary plik z modelami self.oldFilePath = QtGui.QLineEdit(os.path.join(__currentPath__, "param.py")) # nowy plik z modelami self.newFilePath = QtGui.QLineEdit(os.path.join(__currentPath__, "data/dane.cfg")) # self.pominDuplikaty = QtGui.QCheckBox(u"Skip duplicates") self.pominDuplikaty.setChecked(True) self.pominDuplikaty.setDisabled(True) # self.removeOld = QtGui.QCheckBox(u"Remove old database") self.removeOld.setChecked(True) # przyciski buttons = QtGui.QDialogButtonBox() buttons.addButton("Cancel", QtGui.QDialogButtonBox.RejectRole) buttons.addButton("Convert", QtGui.QDialogButtonBox.AcceptRole) self.connect(buttons, QtCore.SIGNAL("accepted()"), self.konwertuj) self.connect(buttons, QtCore.SIGNAL("rejected()"), self, QtCore.SLOT("reject()")) # self.mainLayout = QtGui.QGridLayout(self) #self.mainLayout.setContentsMargins(0, 0, 0, 0) self.mainLayout.addWidget(QtGui.QLabel(u"Old database"), 0, 0, 1, 1) self.mainLayout.addWidget(self.oldFilePath, 0, 1, 1, 1) self.mainLayout.addWidget(QtGui.QLabel(u"New database"), 1, 0, 1, 1) self.mainLayout.addWidget(self.newFilePath, 1, 1, 1, 1) self.mainLayout.addWidget(self.pominDuplikaty, 3, 0, 1, 2) self.mainLayout.addWidget(self.removeOld, 4, 0, 1, 2) self.mainLayout.addWidget(buttons, 5, 1, 1, 1, QtCore.Qt.AlignRight) self.mainLayout.setRowStretch(6, 10)
def setupUi(self, FileAnalyzerDialog): FileAnalyzerDialog.setObjectName("FileAnalyzerDialog") FileAnalyzerDialog.resize(904, 505) self.gridLayoutWidget = QtGui.QWidget(FileAnalyzerDialog) self.gridLayoutWidget.setGeometry(QtCore.QRect(10, 20, 881, 471)) self.gridLayoutWidget.setObjectName("gridLayoutWidget") self.gridLayout = QtGui.QGridLayout(self.gridLayoutWidget) self.gridLayout.setContentsMargins(0, 0, 0, 0) self.gridLayout.setObjectName("gridLayout") self.gridLayout_2 = QtGui.QGridLayout() self.gridLayout_2.setObjectName("gridLayout_2") self.btnRefresh = QtGui.QPushButton(self.gridLayoutWidget) self.btnRefresh.setObjectName("btnRefresh") self.gridLayout_2.addWidget(self.btnRefresh, 1, 0, 1, 1) self.btnExport = QtGui.QPushButton(self.gridLayoutWidget) self.btnExport.setObjectName("btnExport") self.gridLayout_2.addWidget(self.btnExport, 0, 0, 1, 1) self.btnPivot = QtGui.QPushButton(self.gridLayoutWidget) self.btnPivot.setObjectName("btnPivot") self.gridLayout_2.addWidget(self.btnPivot, 2, 0, 1, 1) self.gridLayout.addLayout(self.gridLayout_2, 0, 0, 1, 1) self.buttonBox = QtGui.QDialogButtonBox(self.gridLayoutWidget) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.gridLayout.addWidget(self.buttonBox, 1, 1, 1, 1) self.tableView = QtGui.QTableView(self.gridLayoutWidget) self.tableView.setObjectName("tableView") self.gridLayout.addWidget(self.tableView, 0, 1, 1, 1) self.retranslateUi(FileAnalyzerDialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), FileAnalyzerDialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), FileAnalyzerDialog.reject) QtCore.QMetaObject.connectSlotsByName(FileAnalyzerDialog)
def setupUi(self, LineEditDialog): LineEditDialog.setObjectName("LineEditDialog") LineEditDialog.resize(294, 112) self.verticalLayoutWidget = QtGui.QWidget(LineEditDialog) self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 271, 91)) self.verticalLayoutWidget.setObjectName("verticalLayoutWidget") self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.gridLayout = QtGui.QGridLayout() self.gridLayout.setObjectName("gridLayout") self.label = QtGui.QLabel(self.verticalLayoutWidget) self.label.setObjectName("label") self.gridLayout.addWidget(self.label, 0, 0, 1, 1) self.lineEdit = QtGui.QLineEdit(self.verticalLayoutWidget) self.lineEdit.setObjectName("lineEdit") self.gridLayout.addWidget(self.lineEdit, 0, 1, 1, 1) self.verticalLayout.addLayout(self.gridLayout) self.buttonBox = QtGui.QDialogButtonBox(self.verticalLayoutWidget) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(LineEditDialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), LineEditDialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), LineEditDialog.reject) QtCore.QMetaObject.connectSlotsByName(LineEditDialog)
def setupUi(self, DirectoryViewDialog): DirectoryViewDialog.setObjectName("DirectoryViewDialog") DirectoryViewDialog.resize(408, 337) self.gridLayoutWidget = QtGui.QWidget(DirectoryViewDialog) self.gridLayoutWidget.setGeometry(QtCore.QRect(20, 20, 371, 301)) self.gridLayoutWidget.setObjectName("gridLayoutWidget") self.gridLayout = QtGui.QGridLayout(self.gridLayoutWidget) self.gridLayout.setContentsMargins(0, 0, 0, 0) self.gridLayout.setObjectName("gridLayout") self.gridLayout_2 = QtGui.QGridLayout() self.gridLayout_2.setObjectName("gridLayout_2") self.btnRefresh = QtGui.QPushButton(self.gridLayoutWidget) self.btnRefresh.setObjectName("btnRefresh") self.gridLayout_2.addWidget(self.btnRefresh, 4, 0, 1, 1) self.btnUpload = QtGui.QPushButton(self.gridLayoutWidget) self.btnUpload.setObjectName("btnUpload") self.gridLayout_2.addWidget(self.btnUpload, 0, 0, 1, 1) self.btnDelete = QtGui.QPushButton(self.gridLayoutWidget) self.btnDelete.setObjectName("btnDelete") self.gridLayout_2.addWidget(self.btnDelete, 3, 0, 1, 1) self.btnDownload = QtGui.QPushButton(self.gridLayoutWidget) self.btnDownload.setObjectName("btnDownload") self.gridLayout_2.addWidget(self.btnDownload, 1, 0, 1, 1) self.btnAddFolder = QtGui.QPushButton(self.gridLayoutWidget) self.btnAddFolder.setObjectName("btnAddFolder") self.gridLayout_2.addWidget(self.btnAddFolder, 2, 0, 1, 1) self.gridLayout.addLayout(self.gridLayout_2, 0, 0, 1, 1) self.treeView = QtGui.QTreeView(self.gridLayoutWidget) self.treeView.setObjectName("treeView") self.gridLayout.addWidget(self.treeView, 0, 1, 1, 1) self.buttonBox = QtGui.QDialogButtonBox(self.gridLayoutWidget) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.gridLayout.addWidget(self.buttonBox, 1, 1, 1, 1) self.retranslateUi(DirectoryViewDialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), DirectoryViewDialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), DirectoryViewDialog.reject) QtCore.QMetaObject.connectSlotsByName(DirectoryViewDialog)
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(680, 403) self.gridLayout = QtGui.QGridLayout(Dialog) self.gridLayout.setObjectName("gridLayout") self.labelVersion = QtGui.QLabel(Dialog) self.labelVersion.setObjectName("labelVersion") self.gridLayout.addWidget(self.labelVersion, 0, 0, 1, 1) self.labelSupport = QtGui.QLabel(Dialog) self.labelSupport.setObjectName("labelSupport") self.gridLayout.addWidget(self.labelSupport, 1, 0, 1, 1) self.labelLicense = QtGui.QLabel(Dialog) self.labelLicense.setObjectName("labelLicense") self.gridLayout.addWidget(self.labelLicense, 2, 0, 1, 1) self.pushButton = QtGui.QPushButton(Dialog) self.pushButton.setText("") icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(":/icon/mpowertcx icon flat.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton.setIcon(icon) self.pushButton.setIconSize(QtCore.QSize(256, 256)) self.pushButton.setFlat(True) self.pushButton.setObjectName("pushButton") self.gridLayout.addWidget(self.pushButton, 3, 1, 1, 1) spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem, 4, 1, 1, 1) self.licenseEdit = QtGui.QPlainTextEdit(Dialog) self.licenseEdit.setFrameShape(QtGui.QFrame.Box) self.licenseEdit.setReadOnly(True) self.licenseEdit.setObjectName("licenseEdit") self.gridLayout.addWidget(self.licenseEdit, 3, 0, 2, 1) self.buttonBox = QtGui.QDialogButtonBox(Dialog) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok) self.buttonBox.setCenterButtons(True) self.buttonBox.setObjectName("buttonBox") self.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 2) self.retranslateUi(Dialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject) QtCore.QMetaObject.connectSlotsByName(Dialog)
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(756, 395) self.gridLayout = QtGui.QGridLayout(Dialog) self.gridLayout.setObjectName("gridLayout") self.labelVersion = QtGui.QLabel(Dialog) self.labelVersion.setObjectName("labelVersion") self.gridLayout.addWidget(self.labelVersion, 0, 0, 1, 1) self.labelSupport = QtGui.QLabel(Dialog) self.labelSupport.setObjectName("labelSupport") self.gridLayout.addWidget(self.labelSupport, 1, 0, 1, 1) self.labelLicense = QtGui.QLabel(Dialog) self.labelLicense.setObjectName("labelLicense") self.gridLayout.addWidget(self.labelLicense, 2, 0, 1, 1) self.pushButton = QtGui.QPushButton(Dialog) self.pushButton.setText("") icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(":/icon/mpowertcx icon flat.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.pushButton.setIcon(icon) self.pushButton.setIconSize(QtCore.QSize(256, 256)) self.pushButton.setFlat(True) self.pushButton.setObjectName("pushButton") self.gridLayout.addWidget(self.pushButton, 3, 1, 1, 1) spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout.addItem(spacerItem, 4, 1, 1, 1) self.licenseEdit = QtGui.QPlainTextEdit(Dialog) self.licenseEdit.setFrameShape(QtGui.QFrame.NoFrame) self.licenseEdit.setReadOnly(True) self.licenseEdit.setObjectName("licenseEdit") self.gridLayout.addWidget(self.licenseEdit, 3, 0, 2, 1) self.buttonBox = QtGui.QDialogButtonBox(Dialog) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok) self.buttonBox.setCenterButtons(True) self.buttonBox.setObjectName("buttonBox") self.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 2) self.retranslateUi(Dialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject) QtCore.QMetaObject.connectSlotsByName(Dialog)
def __init__(self, sql, parent=None): QtGui.QDialog.__init__(self, parent) self.setWindowTitle(u'Import database') self.sql = sql # file self.filePath = QtGui.QLineEdit('') self.filePath.setReadOnly(True) filePathButton = QtGui.QPushButton('...') self.connect(filePathButton, QtCore.SIGNAL("clicked()"), self.chooseFile) filePathFrame = QtGui.QFrame() filePathFrame.setObjectName('lay_path_widget') filePathFrame.setStyleSheet('''#lay_path_widget {background-color:#fff; border:1px solid rgb(199, 199, 199); padding: 5px;}''') filePathLayout = QtGui.QHBoxLayout(filePathFrame) filePathLayout.addWidget(QtGui.QLabel(u'File:\t')) filePathLayout.addWidget(self.filePath) filePathLayout.addWidget(filePathButton) filePathLayout.setContentsMargins(0, 0, 0, 0) # tabs self.tabs = QtGui.QTabWidget() self.tabs.setTabPosition(QtGui.QTabWidget.West) self.tabs.setObjectName('tabs_widget') self.tabs.addTab(self.tabCategories(), u'Categories') self.tabs.addTab(self.tabModels(), u'Models') self.tabs.setTabEnabled(1, False) self.connect(self.tabs, QtCore.SIGNAL("currentChanged (int)"), self.activeModelsTab) # buttons buttons = QtGui.QDialogButtonBox() buttons.addButton("Cancel", QtGui.QDialogButtonBox.RejectRole) buttons.addButton("Import", QtGui.QDialogButtonBox.AcceptRole) self.connect(buttons, QtCore.SIGNAL("accepted()"), self, QtCore.SLOT("accept()")) self.connect(buttons, QtCore.SIGNAL("rejected()"), self, QtCore.SLOT("reject()")) buttonsFrame = QtGui.QFrame() buttonsFrame.setObjectName('lay_path_widget') buttonsFrame.setStyleSheet('''#lay_path_widget {background-color:#fff; border:1px solid rgb(199, 199, 199); padding: 5px;}''') buttonsLayout = QtGui.QHBoxLayout(buttonsFrame) buttonsLayout.addWidget(buttons) buttonsLayout.setContentsMargins(0, 0, 0, 0) # main layout lay = QtGui.QGridLayout(self) lay.addWidget(filePathFrame, 0, 0, 1, 1) lay.addWidget(self.tabs, 1, 0, 1, 1) lay.addWidget(buttonsFrame, 2, 0, 1, 1) lay.setRowStretch(1, 10) lay.setContentsMargins(5, 5, 5, 5)
def create_download_bar(self): hlayout = QtGui.QHBoxLayout() vlayout = QtGui.QVBoxLayout() vlayout.setContentsMargins(5, 5, 5, 5) vlayout.setSpacing(5) hlayout.setSpacing(5) hlayout.setContentsMargins(5, 5, 5, 5) progress_label = QtGui.QLabel('') progress_bar = QtGui.QProgressBar() progress_bar.setVisible(False) progress_bar.setContentsMargins(5, 5, 5, 5) vlayout.addWidget(progress_label) vlayout.addWidget(progress_bar) vlayout.addWidget(QtGui.QLabel('')) ex_button = QtGui.QPushButton('Export') ex_button.setEnabled(False) cancel_button = QtGui.QPushButton('Cancel Download') cancel_button.setEnabled(False) open_export_button = QtGui.QPushButton() open_export_button.setEnabled(False) open_export_button.setIcon(QtGui.QIcon(get_file('files/images/folder_open.png'))) open_export_button.setToolTip('Open Export Folder') open_export_button.setStatusTip('Open Export Folder') open_export_button.setMaximumWidth(30) open_export_button.setMaximumHeight(30) ex_button.clicked.connect(self.call_with_object('export', ex_button, cancel_button)) cancel_button.clicked.connect(self.cancel_download) open_export_button.clicked.connect(self.call_with_object('open_export', open_export_button)) button_box = QtGui.QDialogButtonBox() button_box.addButton(open_export_button, QtGui.QDialogButtonBox.NoRole) button_box.addButton(cancel_button, QtGui.QDialogButtonBox.RejectRole) button_box.addButton(ex_button, QtGui.QDialogButtonBox.AcceptRole) hlayout.addLayout(vlayout) hlayout.addWidget(button_box) self.progress_label = progress_label self.progress_bar = progress_bar self.cancel_button = cancel_button self.open_export_button = open_export_button http = QHttp(self) http.sslErrors.connect(self.https_error) http.requestFinished.connect(self.http_request_finished) http.dataReadProgress.connect(self.update_progress_bar) http.responseHeaderReceived.connect(self.read_response_header) self.http = http self.ex_button = ex_button return hlayout
def setupUi(self, NewProjectDialog): NewProjectDialog.setObjectName("NewProjectDialog") NewProjectDialog.resize(514, 243) self.buttonBox = QtGui.QDialogButtonBox(NewProjectDialog) self.buttonBox.setGeometry(QtCore.QRect(50, 180, 341, 32)) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.formLayoutWidget = QtGui.QWidget(NewProjectDialog) self.formLayoutWidget.setGeometry(QtCore.QRect(9, 40, 481, 111)) self.formLayoutWidget.setObjectName("formLayoutWidget") self.formLayout = QtGui.QFormLayout(self.formLayoutWidget) self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow) self.formLayout.setContentsMargins(0, 0, 0, 0) self.formLayout.setObjectName("formLayout") self.nameLabel = QtGui.QLabel(self.formLayoutWidget) self.nameLabel.setObjectName("nameLabel") self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.nameLabel) self.settingsFileLabel = QtGui.QLabel(self.formLayoutWidget) self.settingsFileLabel.setObjectName("settingsFileLabel") self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.settingsFileLabel) self.nameGridLayout = QtGui.QGridLayout() self.nameGridLayout.setObjectName("nameGridLayout") self.namePushButton = QtGui.QPushButton(self.formLayoutWidget) self.namePushButton.setObjectName("namePushButton") self.nameGridLayout.addWidget(self.namePushButton, 0, 1, 1, 1) self.nameLineEdit = QtGui.QLineEdit(self.formLayoutWidget) self.nameLineEdit.setObjectName("nameLineEdit") self.nameGridLayout.addWidget(self.nameLineEdit, 0, 0, 1, 1) self.formLayout.setLayout(0, QtGui.QFormLayout.FieldRole, self.nameGridLayout) self.settingsFileGridLayout = QtGui.QGridLayout() self.settingsFileGridLayout.setObjectName("settingsFileGridLayout") self.settingsFilePushButton = QtGui.QPushButton(self.formLayoutWidget) self.settingsFilePushButton.setObjectName("settingsFilePushButton") self.settingsFileGridLayout.addWidget(self.settingsFilePushButton, 0, 1, 1, 1) self.settingsFileLineEdit = QtGui.QLineEdit(self.formLayoutWidget) self.settingsFileLineEdit.setObjectName("settingsFileLineEdit") self.settingsFileGridLayout.addWidget(self.settingsFileLineEdit, 0, 0, 1, 1) self.formLayout.setLayout(1, QtGui.QFormLayout.FieldRole, self.settingsFileGridLayout) self.retranslateUi(NewProjectDialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), NewProjectDialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), NewProjectDialog.reject) QtCore.QMetaObject.connectSlotsByName(NewProjectDialog)
def setupUi(self, MapGrid): MapGrid.setObjectName("MapGrid") MapGrid.resize(400, 300) self.gridLayout_3 = QtGui.QGridLayout(MapGrid) self.gridLayout_3.setObjectName("gridLayout_3") self.gridLayout_2 = QtGui.QGridLayout() self.gridLayout_2.setObjectName("gridLayout_2") self.gridLayout = QtGui.QGridLayout() self.gridLayout.setObjectName("gridLayout") self.comboBoxLeft = QtGui.QComboBox(MapGrid) self.comboBoxLeft.setObjectName("comboBoxLeft") self.gridLayout.addWidget(self.comboBoxLeft, 1, 0, 1, 1) self.comboBoxRight = QtGui.QComboBox(MapGrid) self.comboBoxRight.setObjectName("comboBoxRight") self.gridLayout.addWidget(self.comboBoxRight, 1, 1, 1, 1) self.labelLeft = QtGui.QLabel(MapGrid) self.labelLeft.setAlignment(QtCore.Qt.AlignCenter) self.labelLeft.setObjectName("labelLeft") self.gridLayout.addWidget(self.labelLeft, 0, 0, 1, 1) self.labelRight = QtGui.QLabel(MapGrid) self.labelRight.setAlignment(QtCore.Qt.AlignCenter) self.labelRight.setMargin(0) self.labelRight.setObjectName("labelRight") self.gridLayout.addWidget(self.labelRight, 0, 1, 1, 1) self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1) self.btnDelete = QtGui.QPushButton(MapGrid) self.btnDelete.setObjectName("btnDelete") self.gridLayout_2.addWidget(self.btnDelete, 2, 0, 1, 1) self.btnAdd = QtGui.QPushButton(MapGrid) self.btnAdd.setObjectName("btnAdd") self.gridLayout_2.addWidget(self.btnAdd, 1, 0, 1, 1) self.tableView = QtGui.QTableView(MapGrid) self.tableView.setObjectName("tableView") self.gridLayout_2.addWidget(self.tableView, 4, 0, 1, 1) self.gridLayout_3.addLayout(self.gridLayout_2, 0, 0, 1, 1) self.btnBox = QtGui.QDialogButtonBox(MapGrid) self.btnBox.setOrientation(QtCore.Qt.Horizontal) self.btnBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.btnBox.setObjectName("btnBox") self.gridLayout_3.addWidget(self.btnBox, 1, 0, 1, 1) self.retranslateUi(MapGrid) QtCore.QObject.connect(self.btnBox, QtCore.SIGNAL("accepted()"), MapGrid.accept) QtCore.QObject.connect(self.btnBox, QtCore.SIGNAL("rejected()"), MapGrid.reject) QtCore.QMetaObject.connectSlotsByName(MapGrid)