我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用PyQt4.QtGui.QDialogButtonBox()。
def setupUi(self, FileBrowser): FileBrowser.setObjectName("FileBrowser") FileBrowser.resize(400, 300) self.verticalLayout = QtGui.QVBoxLayout(FileBrowser) self.verticalLayout.setObjectName("verticalLayout") self.splitter = QtGui.QSplitter(FileBrowser) self.splitter.setOrientation(QtCore.Qt.Vertical) self.splitter.setObjectName("splitter") self.treeView = QtGui.QTreeView(self.splitter) self.treeView.setObjectName("treeView") self.buttonBox = QtGui.QDialogButtonBox(self.splitter) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.splitter) self.retranslateUi(FileBrowser) QtCore.QMetaObject.connectSlotsByName(FileBrowser)
def __init__(self, window): super().__init__(window) self.window = window self.setWindowTitle('Structure') layout_grid = QtGui.QGridLayout(self) self.figure = plt.figure() self.canvas = FigureCanvasQTAgg(self.figure) self.label = QtGui.QLabel() layout_grid.addWidget(self.label,0,0,1,3) layout_grid.addWidget(self.canvas,1,0,1,3) # OK and Cancel buttons self.buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Yes | QtGui.QDialogButtonBox.No | QtGui.QDialogButtonBox.Cancel, QtCore.Qt.Horizontal, self) layout_grid.addWidget(self.buttons) self.buttons.button(QtGui.QDialogButtonBox.Yes).clicked.connect(self.on_accept) self.buttons.button(QtGui.QDialogButtonBox.No).clicked.connect(self.on_reject) self.buttons.button(QtGui.QDialogButtonBox.Cancel).clicked.connect(self.on_cancel)
def setupUi(self, Dialog, mymodel): Dialog.setObjectName(_fromUtf8("Downloads_Dialog")) Dialog.resize(740, 440) self.verticalLayout = QtGui.QVBoxLayout(Dialog) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.tableView = DownloadsTable(mymodel) self.tableView.setObjectName(_fromUtf8("tableView")) self.verticalLayout.addWidget(self.tableView) self.buttonBox = QtGui.QDialogButtonBox(Dialog) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close) self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(Dialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject) QtCore.QMetaObject.connectSlotsByName(Dialog)
def setupUi(self, Dialog): Dialog.resize(640, 165) Dialog.setWindowTitle("Add Bookmark") self.gridLayout = QtGui.QGridLayout(Dialog) self.label = QtGui.QLabel(Dialog) self.label.setText("Title :") self.gridLayout.addWidget(self.label, 0, 0, 1, 1) self.titleEdit = QtGui.QLineEdit(Dialog) self.gridLayout.addWidget(self.titleEdit, 0, 1, 1, 1) self.label_2 = QtGui.QLabel(Dialog) self.label_2.setText("Address :") self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1) self.addressEdit = QtGui.QLineEdit(Dialog) self.gridLayout.addWidget(self.addressEdit, 1, 1, 1, 1) self.buttonBox = QtGui.QDialogButtonBox(Dialog) self.buttonBox.setLayoutDirection(QtCore.Qt.LeftToRight) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) self.gridLayout.addWidget(self.buttonBox, 2, 0, 1, 2) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject)
def setupUi(self, Alert): Alert.setObjectName("Alert") Alert.resize(400, 93) self.verticalLayout = QtGui.QVBoxLayout(Alert) self.verticalLayout.setObjectName("verticalLayout") self.gridLayout = QtGui.QGridLayout() self.gridLayout.setObjectName("gridLayout") spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem, 0, 0, 1, 1) self.label = QtGui.QLabel(Alert) self.label.setObjectName("label") self.gridLayout.addWidget(self.label, 0, 1, 1, 1) spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem1, 0, 2, 1, 1) self.verticalLayout.addLayout(self.gridLayout) self.buttonBox = QtGui.QDialogButtonBox(Alert) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(Alert) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Alert.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Alert.reject) QtCore.QMetaObject.connectSlotsByName(Alert)
def initUI(self): grid = QtGui.QGridLayout() grid.addWidget(QtGui.QLabel(u'????:', parent=self), 0, 0, 1, 1) self.filter = QtGui.QLineEdit(parent=self) grid.addWidget(self.filter, 0, 1, 1, 1) # ??ButtonBox???????? buttonBox = QtGui.QDialogButtonBox(parent=self) buttonBox.setOrientation(QtCore.Qt.Horizontal) # ??????? buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) # ????????? # ?????? buttonBox.accepted.connect(self.accept) # ?? buttonBox.rejected.connect(self.reject) # ?? # ???????????? layout = QtGui.QVBoxLayout() # ??????????? layout.addLayout(grid) # ??????????? spacerItem = QtGui.QSpacerItem(20, 48, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) layout.addItem(spacerItem) # ButtonBox layout.addWidget(buttonBox) self.setLayout(layout)
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(400, 300) self.verticalLayout = QtGui.QVBoxLayout(Dialog) self.verticalLayout.setObjectName("verticalLayout") self.textview = QtGui.QPlainTextEdit(Dialog) self.textview.setObjectName("textview") self.verticalLayout.addWidget(self.textview) self.buttonBox = QtGui.QDialogButtonBox(Dialog) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.buttonBox) 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(_fromUtf8("Dialog")) Dialog.resize(400, 300) self.verticalLayout = QtGui.QVBoxLayout(Dialog) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.textview = QtGui.QPlainTextEdit(Dialog) self.textview.setObjectName(_fromUtf8("textview")) self.verticalLayout.addWidget(self.textview) self.buttonBox = QtGui.QDialogButtonBox(Dialog) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close) self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(Dialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject) QtCore.QMetaObject.connectSlotsByName(Dialog)
def setupUi(self, StaticHelp): StaticHelp.setObjectName(_fromUtf8("StaticHelp")) StaticHelp.resize(698, 595) self.verticalLayout = QtGui.QVBoxLayout(StaticHelp) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.help_view = QtWebKit.QWebView(StaticHelp) self.help_view.setUrl(QtCore.QUrl(_fromUtf8("about:blank"))) self.help_view.setObjectName(_fromUtf8("help_view")) self.verticalLayout.addWidget(self.help_view) self.buttonBox = QtGui.QDialogButtonBox(StaticHelp) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close) self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(StaticHelp) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), StaticHelp.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), StaticHelp.reject) QtCore.QMetaObject.connectSlotsByName(StaticHelp)
def __init__(self, parent=None): super(GetMany, self).__init__(parent) layout = QtGui.QVBoxLayout(self) layout.addWidget(QtGui.QLabel('Enter Coordinates')) self.text = QtGui.QPlainTextEdit() self.text.setPlainText('Enter list of coordinates separated by spaces or commas. west lat.,' \ + ' north lon., east lat., south lon. ...') layout.addWidget(self.text) # OK and Cancel buttons buttons = QtGui.QDialogButtonBox( QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel, QtCore.Qt.Horizontal, self) buttons.accepted.connect(self.accept) buttons.rejected.connect(self.reject) layout.addWidget(buttons) self.setWindowTitle('SIREN - worldwindow (' + fileVersion() + ") - List of Coordinates")
def setupUi(self, qgpkgDlg): qgpkgDlg.setObjectName(_fromUtf8("qgpkgDlg")) qgpkgDlg.resize(456, 358) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/plugins/QgisGeopackage/about.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) qgpkgDlg.setWindowIcon(icon) self.verticalLayout = QtGui.QVBoxLayout(qgpkgDlg) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.textEdit = QtGui.QTextEdit(qgpkgDlg) self.textEdit.setReadOnly(True) self.textEdit.setObjectName(_fromUtf8("textEdit")) self.verticalLayout.addWidget(self.textEdit) self.button_box = QtGui.QDialogButtonBox(qgpkgDlg) self.button_box.setOrientation(QtCore.Qt.Horizontal) self.button_box.setStandardButtons(QtGui.QDialogButtonBox.Close) self.button_box.setObjectName(_fromUtf8("button_box")) self.verticalLayout.addWidget(self.button_box) self.retranslateUi(qgpkgDlg) QtCore.QObject.connect(self.button_box, QtCore.SIGNAL(_fromUtf8("accepted()")), qgpkgDlg.accept) QtCore.QObject.connect(self.button_box, QtCore.SIGNAL(_fromUtf8("rejected()")), qgpkgDlg.reject) QtCore.QMetaObject.connectSlotsByName(qgpkgDlg)
def setupUi(self, Dialog): Dialog.setObjectName(_fromUtf8("Dialog")) Dialog.resize(400, 113) self.buttonBox = QtGui.QDialogButtonBox(Dialog) self.buttonBox.setGeometry(QtCore.QRect(40, 60, 341, 32)) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.label = QtGui.QLabel(Dialog) self.label.setGeometry(QtCore.QRect(10, 30, 71, 16)) self.label.setObjectName(_fromUtf8("label")) self.textEdit = QtGui.QTextEdit(Dialog) self.textEdit.setGeometry(QtCore.QRect(90, 30, 291, 21)) self.textEdit.setObjectName(_fromUtf8("textEdit")) self.sbRepeats = QtGui.QSpinBox(Dialog) self.sbRepeats.setGeometry(QtCore.QRect(90, 60, 50, 21)) self.sbRepeats.setObjectName(_fromUtf8("textEdit")) self.sbRepeats.setMinimum(1) self.sbRepeats.setMaximum(99) self.retranslateUi(Dialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), self.Accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), self.Reject) QtCore.QMetaObject.connectSlotsByName(Dialog) self.dlg = Dialog
def setupUi(self, Dialog): self.dlg = Dialog Dialog.setObjectName(_fromUtf8("Dialog")) Dialog.resize(385, 114) self.buttonBox = QtGui.QDialogButtonBox(Dialog) self.buttonBox.setGeometry(QtCore.QRect(10, 50, 341, 32)) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.label = QtGui.QLabel(Dialog) self.label.setGeometry(QtCore.QRect(20, 20, 71, 16)) self.label.setObjectName(_fromUtf8("label")) self.spinBox = QtGui.QSpinBox(Dialog) self.spinBox.setGeometry(QtCore.QRect(100, 20, 42, 22)) self.spinBox.setObjectName(_fromUtf8("spinBox")) self.spinBox.setMinimum(-80) self.spinBox.setMaximum(80) self.retranslateUi(Dialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), self.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), self.reject) QtCore.QMetaObject.connectSlotsByName(Dialog)
def __init__(self, window): super().__init__(window) self.window = window self.setWindowTitle('Structure') layout_grid = QtGui.QGridLayout(self) self.figure = plt.figure() self.canvas = FigureCanvasQTAgg(self.figure) self.label = QtGui.QLabel() layout_grid.addWidget(self.label, 0, 0, 1, 3) layout_grid.addWidget(self.canvas, 1, 0, 1, 3) # OK and Cancel buttons self.buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Yes | QtGui.QDialogButtonBox.No | QtGui.QDialogButtonBox.Cancel, QtCore.Qt.Horizontal, self) layout_grid.addWidget(self.buttons) self.buttons.button(QtGui.QDialogButtonBox.Yes).clicked.connect(self.on_accept) self.buttons.button(QtGui.QDialogButtonBox.No).clicked.connect(self.on_reject) self.buttons.button(QtGui.QDialogButtonBox.Cancel).clicked.connect(self.on_cancel)
def __init__(self, main, *args, **kwargs): QtGui.QFileDialog.__init__(self, *args, **kwargs) self.setDirectory(QtCore.QDir.homePath()) # self.setDirectory('/home/mauriziob/data/code/blofeld/test/') self.main = main self.setOption(self.DontUseNativeDialog) self.setAcceptMode(self.AcceptOpen) self.setFileMode(self.ExistingFile) self.buttonBox = self.findChildren(QtGui.QDialogButtonBox)[0] self.open_btn = [b for b in self.buttonBox.buttons() if self.buttonBox.buttonRole(b) == QtGui.QDialogButtonBox.AcceptRole][0] self.setNameFilters(('Wave files (*.wav)', 'Any files (*)')) self.setSidebarUrls([QtCore.QUrl.fromLocalFile(QtCore.QDir.homePath()), QtCore.QUrl.fromLocalFile(QtGui.QDesktopServices.storageLocation(QtGui.QDesktopServices.MusicLocation))]) self.splitter = self.findChildren(QtGui.QSplitter)[0] self.wave_panel = WavePanel(self) self.wave_panel.isValid.connect(self.open_enable) self.valid = False self.splitter.addWidget(self.wave_panel) self.splitter.setCollapsible(2, False) self.currentChanged.connect(self.wave_panel.setWave)
def closeDetect(self, win=None): if win: win_list = set((self.librarian, self.editor) + tuple(self.wavetable_windows_list)) win_list.discard(win) if any(win.isVisible() for win in win_list): return True if not self.library_changed(): return True msgbox = QtGui.QMessageBox( QtGui.QMessageBox.Question, 'Confirm exit', 'The library has been modified, do you want to quit anyway?', QtGui.QMessageBox.Abort|QtGui.QMessageBox.Save|QtGui.QMessageBox.Cancel, self.librarian ) buttonBox = msgbox.findChild(QtGui.QDialogButtonBox) abort_btn = buttonBox.button(QtGui.QDialogButtonBox.Abort) abort_btn.setText('Ignore and quit') abort_btn.setIcon(QtGui.QIcon.fromTheme('application-exit')) res = msgbox.exec_() if res == QtGui.QMessageBox.Cancel: return False elif res == QtGui.QMessageBox.Abort: return True self.save_library() return True
def setupUi(self, selectorDialogForm): selectorDialogForm.setObjectName("selectorDialogForm") selectorDialogForm.setWindowModality(QtCore.Qt.WindowModal) selectorDialogForm.setModal(False) # selectorDialogForm.setWindowModality(QtCore.Qt.ApplicationModal) selectorDialogForm.resize(500,300) self.buttonBox = QtGui.QDialogButtonBox(selectorDialogForm) self.buttonBox.setGeometry(QtCore.QRect(30,240,341,32)) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.listWidget = QtGui.QListWidget(selectorDialogForm) self.listWidget.setGeometry(QtCore.QRect(70,20,360,200)) font = QtGui.QFont() font.setPointSize(14) self.listWidget.setFont(font) self.listWidget.setObjectName("listWidget") self.retranslateUi(selectorDialogForm) QtCore.QObject.connect(self.buttonBox,QtCore.SIGNAL("accepted()"),selectorDialogForm.accept) QtCore.QObject.connect(self.buttonBox,QtCore.SIGNAL("rejected()"),selectorDialogForm.reject) QtCore.QMetaObject.connectSlotsByName(selectorDialogForm)
def autosave_path(self): def check(): path = win.selectedFiles()[0] if QtCore.QFileInfo(path).permissions() & QtCore.QFile.WriteOwner: win.accept() self.autosave_path_edit.setText(path) else: QtGui.QMessageBox.warning(win, 'Write error', 'The selected path has no write permissions.') win = QtGui.QFileDialog(self, 'Select output directory') win.setFileMode(QtGui.QFileDialog.Directory) win.setOptions(QtGui.QFileDialog.ShowDirsOnly|QtGui.QFileDialog.HideNameFilterDetails) win.setAcceptMode(QtGui.QFileDialog.AcceptOpen) buttonBox = win.findChild(QtGui.QDialogButtonBox) open_btn = buttonBox.button(QtGui.QDialogButtonBox.Open) open_btn.clicked.disconnect() open_btn.clicked.connect(check) return win.exec_()
def setupUi(self, Dialog): Dialog.resize(316, 238) Dialog.setWindowTitle("Select Resolution") self.verticalLayout = QtGui.QVBoxLayout(Dialog) self.frame = QtGui.QFrame(Dialog) self.frame.setFrameShape(QtGui.QFrame.StyledPanel) self.frame.setFrameShadow(QtGui.QFrame.Raised) self.verticalLayout_2 = QtGui.QVBoxLayout(self.frame) self.buttonGroup = QtGui.QButtonGroup(self.frame) if len(self.videos)>3: checked_btn = 2 else: checked_btn = len(self.videos)-1 for i, video in enumerate(self.videos): radioButton = QtGui.QRadioButton(self.frame) radioButton.setText(video.resolution + " (" + video.extension + ')') self.buttonGroup.addButton(radioButton) self.verticalLayout_2.addWidget(radioButton) if i==checked_btn : radioButton.setChecked(True) spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem) self.verticalLayout.addWidget(self.frame) self.buttonBox = QtGui.QDialogButtonBox(Dialog) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.verticalLayout.addWidget(self.buttonBox) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject) QtCore.QMetaObject.connectSlotsByName(Dialog)
def setupUi(self, Settings): Settings.setObjectName("Settings") Settings.resize(310, 96) Settings.setMinimumSize(QtCore.QSize(310, 96)) Settings.setMaximumSize(QtCore.QSize(310, 96)) self.layoutWidget = QtGui.QWidget(Settings) self.layoutWidget.setGeometry(QtCore.QRect(0, 0, 310, 104)) self.layoutWidget.setObjectName("layoutWidget") self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget) self.verticalLayout.setObjectName("verticalLayout") self.gridLayout = QtGui.QGridLayout() self.gridLayout.setObjectName("gridLayout") self.label_3 = QtGui.QLabel(self.layoutWidget) self.label_3.setObjectName("label_3") self.gridLayout.addWidget(self.label_3, 0, 0, 1, 1) self.path = QtGui.QLineEdit(self.layoutWidget) self.path.setObjectName("path") self.gridLayout.addWidget(self.path, 0, 1, 1, 1) self.browse = QtGui.QPushButton(self.layoutWidget) self.browse.setObjectName("browse") self.gridLayout.addWidget(self.browse, 0, 2, 1, 1) self.verticalLayout.addLayout(self.gridLayout) self.buttonBox = QtGui.QDialogButtonBox(self.layoutWidget) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(Settings) QtCore.QMetaObject.connectSlotsByName(Settings)
def setupUi(self, Dialog): Dialog.setObjectName(_fromUtf8("Dialog")) Dialog.resize(196, 71) self.verticalLayout_2 = QtGui.QVBoxLayout(Dialog) self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2")) self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.label = QtGui.QLabel(Dialog) self.label.setObjectName(_fromUtf8("label")) self.horizontalLayout.addWidget(self.label) self.lineEdit = QtGui.QLineEdit(Dialog) self.lineEdit.setObjectName(_fromUtf8("lineEdit")) self.horizontalLayout.addWidget(self.lineEdit) self.verticalLayout.addLayout(self.horizontalLayout) self.buttonBox = QtGui.QDialogButtonBox(Dialog) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.verticalLayout.addWidget(self.buttonBox) self.verticalLayout_2.addLayout(self.verticalLayout) self.retranslateUi(Dialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject) QtCore.QMetaObject.connectSlotsByName(Dialog)
def __init__(self, parent=None): super(MyDialog, self).__init__(parent) self.buttonBox = QtGui.QDialogButtonBox(self) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok) self.buttonBox.clicked.connect(self.on_pushButton_clicked) self.textBrowser = QtGui.QLabel(self) self.textBrowser.setText("KAYIT BA?ARILI") self.verticalLayout = QtGui.QVBoxLayout(self) self.verticalLayout.addWidget(self.textBrowser) self.verticalLayout.addWidget(self.buttonBox)
def __init__(self, who, desc='', parent=None): super(Description, self).__init__(parent) layout = QtGui.QVBoxLayout(self) layout.addWidget(QtGui.QLabel('Set Description for ' + who)) self.text = QtGui.QPlainTextEdit() self.text.setPlainText(desc) layout.addWidget(self.text) # OK and Cancel buttons buttons = QtGui.QDialogButtonBox( QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel, QtCore.Qt.Horizontal, self) buttons.accepted.connect(self.accept) buttons.rejected.connect(self.reject) layout.addWidget(buttons) self.setWindowTitle('SIREN - Save Scenario')
def __init__(self): QtGui.QDialog.__init__(self) self.videoDevices = [] for vd in self.getVideoDevices(): self.videoDevices.append(vd) self.setWindowTitle(self.tr('Decode from Webcam')) self.cameraIcon = QtGui.QIcon.fromTheme("camera") self.icon = QtGui.QLabel() self.icon.setPixmap(self.cameraIcon.pixmap(64,64).scaled(64,64)) self.videoDevice = QtGui.QComboBox() self.videoDevice.addItems([vd[0] for vd in self.videoDevices]) self.label = QtGui.QLabel(self.tr("You are about to decode from your webcam. Please put the code in front of your camera with a good light source and keep it steady.\nOnce you see a green rectangle you can close the window by pressing any key.\n\nPlease select the video device you want to use for decoding:")) self.label.setWordWrap(True) self.Buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel) self.Buttons.accepted.connect(self.accept) self.Buttons.rejected.connect(self.reject) self.layout = QtGui.QVBoxLayout() self.hlayout = QtGui.QHBoxLayout() self.vlayout = QtGui.QVBoxLayout() self.hlayout.addWidget(self.icon, 0, QtCore.Qt.AlignTop) self.vlayout.addWidget(self.label) self.vlayout.addWidget(self.videoDevice) self.hlayout.addLayout(self.vlayout) self.layout.addLayout(self.hlayout) self.layout.addStretch() self.layout.addWidget(self.Buttons) self.setLayout(self.layout)
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, MHTImportDialog): MHTImportDialog.setObjectName(_fromUtf8("MHTImportDialog")) MHTImportDialog.resize(400, 150) self.vboxlayout = QtGui.QVBoxLayout(MHTImportDialog) self.vboxlayout.setObjectName(_fromUtf8("vboxlayout")) self.groupBox = QtGui.QGroupBox(MHTImportDialog) self.groupBox.setObjectName(_fromUtf8("groupBox")) self.toplayout = QtGui.QVBoxLayout(self.groupBox) self.toplayout.setObjectName(_fromUtf8("toplayout")) self.gridLayout_2 = QtGui.QGridLayout() self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) self.deckArea = QtGui.QWidget(self.groupBox) self.deckArea.setObjectName(_fromUtf8("deckArea")) self.gridLayout_2.addWidget(self.deckArea, 0, 1, 1, 1) self.label_2 = QtGui.QLabel(self.groupBox) self.label_2.setObjectName(_fromUtf8("label_2")) self.gridLayout_2.addWidget(self.label_2, 0, 0, 1, 1) self.toplayout.addLayout(self.gridLayout_2) self.vboxlayout.addWidget(self.groupBox) self.buttonBox = QtGui.QDialogButtonBox(MHTImportDialog) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close) self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.vboxlayout.addWidget(self.buttonBox) self.retranslateUi(MHTImportDialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), MHTImportDialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), MHTImportDialog.reject) QtCore.QMetaObject.connectSlotsByName(MHTImportDialog)
def __init__(self, window): super().__init__(window) self.window = window # vars = self.view.locs[0].dtype.names self.setWindowTitle('Apply expression') vbox = QtGui.QVBoxLayout(self) layout = QtGui.QGridLayout() vbox.addLayout(layout) layout.addWidget(QtGui.QLabel('Channel:'), 0, 0) self.channel = QtGui.QComboBox() self.channel.addItems(self.window.view.locs_paths) layout.addWidget(self.channel, 0, 1) self.channel.currentIndexChanged.connect(self.update_vars) layout.addWidget(QtGui.QLabel('Pre-defined variables:'), 1, 0) self.label = QtGui.QLabel() layout.addWidget(self.label, 1, 1) self.update_vars(0) layout.addWidget(QtGui.QLabel('Expression:'), 2, 0) self.cmd = QtGui.QLineEdit() layout.addWidget(self.cmd, 2, 1) hbox = QtGui.QHBoxLayout() vbox.addLayout(hbox) # OK and Cancel buttons self.buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel, QtCore.Qt.Horizontal, self) vbox.addWidget(self.buttons) self.buttons.accepted.connect(self.accept) self.buttons.rejected.connect(self.reject) # static method to create the dialog and return (date, time, accepted)
def __init__(self, window): super().__init__(window) self.window = window self.setWindowTitle('Structure') self.showMaximized() self.layout_grid = QtGui.QGridLayout(self) self.figure = plt.figure() self.canvas = FigureCanvasQTAgg(self.figure) self.label = QtGui.QLabel() self.layout_grid.addWidget(self.label,0,0,1,5) self.layout_grid.addWidget(self.canvas,1,0,8,5) self.buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Yes | QtGui.QDialogButtonBox.No | QtGui.QDialogButtonBox.Cancel, QtCore.Qt.Horizontal, self) self.layout_grid.addWidget(self.buttons,10,0,1,3) self.layout_grid.addWidget(QtGui.QLabel('No clusters:'),10,3,1,1) self.n_clusters_spin = QtGui.QSpinBox() self.layout_grid.addWidget(self.n_clusters_spin,10,4,1,1) self.buttons.button(QtGui.QDialogButtonBox.Yes).clicked.connect(self.on_accept) self.buttons.button(QtGui.QDialogButtonBox.No).clicked.connect(self.on_reject) self.buttons.button(QtGui.QDialogButtonBox.Cancel).clicked.connect(self.on_cancel) self.start_clusters = 0 self.n_clusters_spin.valueChanged.connect(self.on_cluster) self.n_lines = 12 self.layout_grid.addWidget(QtGui.QLabel('Select'),11,4,1,1) self.layout_grid.addWidget(QtGui.QLabel('X-Center'),11,0,1,1) self.layout_grid.addWidget(QtGui.QLabel('Y-Center'),11,1,1,1) self.layout_grid.addWidget(QtGui.QLabel('Z-Center'),11,2,1,1) self.layout_grid.addWidget(QtGui.QLabel('Counts'),11,3,1,1) self.checks = []
def __init__(self, window): super().__init__(window) self.window = window self.setWindowTitle('Structure') self.layout_grid = QtGui.QGridLayout(self) self.figure = plt.figure() self.canvas = FigureCanvasQTAgg(self.figure) self.label = QtGui.QLabel() self.layout_grid.addWidget(self.label,0,0,1,5) self.layout_grid.addWidget(self.canvas,1,0,1,5) self.buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Yes | QtGui.QDialogButtonBox.No | QtGui.QDialogButtonBox.Cancel, QtCore.Qt.Horizontal, self) self.layout_grid.addWidget(self.buttons,2,0,1,3) self.layout_grid.addWidget(QtGui.QLabel('No clusters:'),2,3,1,1) self.n_clusters_spin = QtGui.QSpinBox() self.layout_grid.addWidget(self.n_clusters_spin,2,4,1,1) self.buttons.button(QtGui.QDialogButtonBox.Yes).clicked.connect(self.on_accept) self.buttons.button(QtGui.QDialogButtonBox.No).clicked.connect(self.on_reject) self.buttons.button(QtGui.QDialogButtonBox.Cancel).clicked.connect(self.on_cancel) self.start_clusters = 0 self.n_clusters_spin.valueChanged.connect(self.on_cluster) self.n_lines = 4 self.layout_grid.addWidget(QtGui.QLabel('Select'),3,3,1,1) self.layout_grid.addWidget(QtGui.QLabel('X-Center'),3,0,1,1) self.layout_grid.addWidget(QtGui.QLabel('Y-Center'),3,1,1,1) self.layout_grid.addWidget(QtGui.QLabel('Counts'),3,2,1,1) self.checks = []
def __init__(self, window): super().__init__(window) self.window = window self.setWindowTitle('Enter movie info') vbox = QtGui.QVBoxLayout(self) grid = QtGui.QGridLayout() grid.addWidget(QtGui.QLabel('Byte Order:'), 0, 0) self.byte_order = QtGui.QComboBox() self.byte_order.addItems(['Little Endian (loads faster)', 'Big Endian']) grid.addWidget(self.byte_order, 0, 1) grid.addWidget(QtGui.QLabel('Data Type:'), 1, 0) self.dtype = QtGui.QComboBox() self.dtype.addItems(['float16', 'float32', 'float64', 'int8', 'int16', 'int32', 'uint8', 'uint16', 'uint32']) grid.addWidget(self.dtype, 1, 1) grid.addWidget(QtGui.QLabel('Frames:'), 2, 0) self.frames = QtGui.QSpinBox() self.frames.setRange(1, 1e9) grid.addWidget(self.frames, 2, 1) grid.addWidget(QtGui.QLabel('Height:'), 3, 0) self.movie_height = QtGui.QSpinBox() self.movie_height.setRange(1, 1e9) grid.addWidget(self.movie_height, 3, 1) grid.addWidget(QtGui.QLabel('Width'), 4, 0) self.movie_width = QtGui.QSpinBox() self.movie_width.setRange(1, 1e9) grid.addWidget(self.movie_width, 4, 1) self.save = QtGui.QCheckBox('Save info to yaml file') self.save.setChecked(True) grid.addWidget(self.save, 5, 0, 1, 2) vbox.addLayout(grid) hbox = QtGui.QHBoxLayout() vbox.addLayout(hbox) # OK and Cancel buttons self.buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel, QtCore.Qt.Horizontal, self) vbox.addWidget(self.buttons) self.buttons.accepted.connect(self.accept) self.buttons.rejected.connect(self.reject) # static method to create the dialog and return (date, time, accepted)
def __init__(self, mode=ALLFILE, *args, **kwargs): QtGui.QFileDialog.__init__(self, *args, **kwargs) if mode == ALLFILE: self.setNameFilters([_file_types[ALLFILE], _file_types[MIDFILE], _file_types[SYXFILE], 'Any files (*)']) else: self.setNameFilters([_file_types[mode], 'Any files (*)']) self.mode = mode self.res = None self.setWindowTitle(_titles[mode]) self.setFileMode(QtGui.QFileDialog.ExistingFile) self.setOption(QtGui.QFileDialog.HideNameFilterDetails, True) self.setAcceptMode(QtGui.QFileDialog.AcceptOpen) self.setFileMode(QtGui.QFileDialog.ExistingFile) self.setDirectory(QtCore.QDir.homePath()) urls = [] if mode == MIDFILE|SYXFILE: urls.append(_factory) if mode & MIDFILE: urls.append(_midi_sets) if mode & SYXFILE: urls.append(_single_sets) self.setSidebarUrls(urls) buttonBox = self.findChildren(QtGui.QDialogButtonBox)[0] buttonBox.removeButton(buttonBox.button(QtGui.QDialogButtonBox.Open)) self.import_btn = QtGui.QPushButton('Import') self.import_btn.clicked.connect(self.accept) self.import_btn.setIcon(self.style().standardIcon(QtGui.QStyle.SP_DialogOpenButton)) buttonBox.addButton(self.import_btn, QtGui.QDialogButtonBox.ActionRole) self.currentChanged.connect(lambda path: self.import_btn.setText('Open' if QtCore.QFileInfo(path).isDir() else 'Import'))
def __init__(self, parent): QtGui.QDialog.__init__(self, parent) loader = LoaderWidget() layout = QtGui.QGridLayout() layout.setSpacing(10) self.setLayout(layout) label = QtGui.QLabel('Checking for updates, please wait...') label.setAlignment(QtCore.Qt.AlignHCenter) layout.addWidget(label) layout.addWidget(loader, 1, 0, alignment=QtCore.Qt.AlignHCenter) buttonBox = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Cancel) buttonBox.setCenterButtons(True) layout.addWidget(buttonBox)
def setupUi(self, Dialog): Dialog.setObjectName(_fromUtf8("Dialog")) Dialog.resize(400, 300) self.buttonBox = QtGui.QDialogButtonBox(Dialog) self.buttonBox.setGeometry(QtCore.QRect(30, 240, 341, 32)) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.pushButton = QtGui.QPushButton(Dialog) self.pushButton.setGeometry(QtCore.QRect(190, 110, 98, 27)) self.pushButton.setObjectName(_fromUtf8("pushButton")) self.checkBox = QtGui.QCheckBox(Dialog) self.checkBox.setGeometry(QtCore.QRect(190, 200, 97, 22)) self.checkBox.setObjectName(_fromUtf8("checkBox")) self.radioButton = QtGui.QRadioButton(Dialog) self.radioButton.setGeometry(QtCore.QRect(30, 90, 116, 22)) self.radioButton.setObjectName(_fromUtf8("radioButton")) self.commandLinkButton = QtGui.QCommandLinkButton(Dialog) self.commandLinkButton.setGeometry(QtCore.QRect(10, 20, 185, 41)) self.commandLinkButton.setObjectName(_fromUtf8("commandLinkButton")) self.listView = QtGui.QListView(Dialog) self.listView.setGeometry(QtCore.QRect(40, 120, 91, 71)) self.listView.setObjectName(_fromUtf8("listView")) self.listWidget = QtGui.QListWidget(Dialog) self.listWidget.setGeometry(QtCore.QRect(30, 220, 111, 81)) self.listWidget.setObjectName(_fromUtf8("listWidget")) self.pushButton_2 = QtGui.QPushButton(Dialog) self.pushButton_2.setGeometry(QtCore.QRect(190, 60, 98, 27)) self.pushButton_2.setObjectName(_fromUtf8("pushButton_2")) self.retranslateUi(Dialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject) QtCore.QMetaObject.connectSlotsByName(Dialog)
def setupUi(self, mapillaryDialogBase): mapillaryDialogBase.setObjectName(_fromUtf8("mapillaryDialogBase")) mapillaryDialogBase.resize(400, 300) self.button_box = QtGui.QDialogButtonBox(mapillaryDialogBase) self.button_box.setGeometry(QtCore.QRect(30, 240, 341, 32)) self.button_box.setOrientation(QtCore.Qt.Horizontal) self.button_box.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.button_box.setObjectName(_fromUtf8("button_box")) self.retranslateUi(mapillaryDialogBase) QtCore.QObject.connect(self.button_box, QtCore.SIGNAL(_fromUtf8("accepted()")), mapillaryDialogBase.accept) QtCore.QObject.connect(self.button_box, QtCore.SIGNAL(_fromUtf8("rejected()")), mapillaryDialogBase.reject) QtCore.QMetaObject.connectSlotsByName(mapillaryDialogBase)
def __init__(self, parent): QtGui.QDialog.__init__(self, parent) _load_ui(self, 'sourcefilter.ui') self.model = QtGui.QStandardItemModel() self.listview.setModel(self.model) self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(False) self.setter_edit.textChanged.connect(self.enable_ok)
def enable_ok(self, text): self.buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(True if text else False)
def dest_update(self, first_index, last_index): item = self.dest_model.item(first_index.row()) export = item.data(EnabledRole).toBool() item.setEnabled(export) port_item = self.port_dict[item.data(DestRole).toPyObject()] setBold(port_item, export) port_item.export = export if any([self.dest_model.item(i).data(EnabledRole).toBool() for i in range(self.dest_model.rowCount())]): self.buttonBox.button(QtGui.QDialogButtonBox.Save).setEnabled(True if self.export_check() else False) else: self.buttonBox.button(QtGui.QDialogButtonBox.Save).setEnabled(False)
def export_check(self, *args): if any([all([chk.isEnabled(), not chk.isChecked()]) for chk in self.event_widgets.values()]): self.buttonBox.button(QtGui.QDialogButtonBox.Save).setEnabled(True) return True else: self.buttonBox.button(QtGui.QDialogButtonBox.Save).setEnabled(False) return False
def __init__(self, name, database_names): super(ChangeRunnerDialog, self).__init__() self.match = None ## Create QWidget objects self.selectLabel = QtGui.QLabel('Select New') self.nameComboBox = QtGui.QComboBox() self.nameComboBox.addItems(sorted(database_names)) self.newLabel = QtGui.QLabel('Add Runner: {0}'.format(name)) self.newLineEdit = QtGui.QLineEdit() self.hline = QtGui.QFrame() self.hline.setFrameShape(QtGui.QFrame.HLine) self.hline.setFrameShadow(QtGui.QFrame.Sunken) self.buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel, QtCore.Qt.Horizontal, self) ## Connect Signals and Slots self.buttons.accepted.connect(self.update) self.buttons.rejected.connect(self.reject) ## Create Layout layout = QtGui.QVBoxLayout() layout.addWidget(self.selectLabel) layout.addWidget(self.nameComboBox) layout.addWidget(self.hline) layout.addWidget(self.newLabel) layout.addWidget(self.newLineEdit) layout.addWidget(self.buttons) self.setLayout(layout)
def setupUi(self, downloadDialog): downloadDialog.setObjectName(_fromUtf8("downloadDialog")) downloadDialog.resize(638, 233) self.gridLayout = QtGui.QGridLayout(downloadDialog) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.label_5 = QtGui.QLabel(downloadDialog) self.label_5.setObjectName(_fromUtf8("label_5")) self.gridLayout.addWidget(self.label_5, 3, 0, 1, 1) self.label_3 = QtGui.QLabel(downloadDialog) self.label_3.setObjectName(_fromUtf8("label_3")) self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1) self.labelFolder = QtGui.QLabel(downloadDialog) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(1) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.labelFolder.sizePolicy().hasHeightForWidth()) self.labelFolder.setSizePolicy(sizePolicy) self.labelFolder.setObjectName(_fromUtf8("labelFolder")) self.gridLayout.addWidget(self.labelFolder, 0, 1, 1, 1) self.label_6 = QtGui.QLabel(downloadDialog) self.label_6.setObjectName(_fromUtf8("label_6")) self.gridLayout.addWidget(self.label_6, 4, 0, 1, 1) self.label = QtGui.QLabel(downloadDialog) self.label.setObjectName(_fromUtf8("label")) self.gridLayout.addWidget(self.label, 0, 0, 1, 1) self.label_2 = QtGui.QLabel(downloadDialog) self.label_2.setObjectName(_fromUtf8("label_2")) self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1) self.folderButton = QtGui.QPushButton(downloadDialog) self.folderButton.setMaximumSize(QtCore.QSize(80, 16777215)) self.folderButton.setObjectName(_fromUtf8("folderButton")) self.gridLayout.addWidget(self.folderButton, 0, 2, 1, 1) self.filenameEdit = QtGui.QLineEdit(downloadDialog) self.filenameEdit.setObjectName(_fromUtf8("filenameEdit")) self.gridLayout.addWidget(self.filenameEdit, 1, 1, 1, 2) self.labelFileSize = QtGui.QLabel(downloadDialog) self.labelFileSize.setObjectName(_fromUtf8("labelFileSize")) self.gridLayout.addWidget(self.labelFileSize, 2, 1, 1, 2) self.labelResume = QtGui.QLabel(downloadDialog) self.labelResume.setObjectName(_fromUtf8("labelResume")) self.gridLayout.addWidget(self.labelResume, 3, 1, 1, 2) self.labelFileType = QtGui.QLabel(downloadDialog) self.labelFileType.setObjectName(_fromUtf8("labelFileType")) self.gridLayout.addWidget(self.labelFileType, 4, 1, 1, 2) self.dialogButtonBox = QtGui.QDialogButtonBox(downloadDialog) self.dialogButtonBox.setOrientation(QtCore.Qt.Horizontal) self.dialogButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.dialogButtonBox.setObjectName(_fromUtf8("dialogButtonBox")) self.gridLayout.addWidget(self.dialogButtonBox, 5, 0, 1, 3) self.retranslateUi(downloadDialog) QtCore.QObject.connect(self.dialogButtonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), downloadDialog.accept) QtCore.QObject.connect(self.dialogButtonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), downloadDialog.reject) QtCore.QMetaObject.connectSlotsByName(downloadDialog)
def setupUi(self, Dialog, bookmark_data, favourites): Dialog.resize(740, 450) Dialog.setWindowTitle('Bookmarks Manager') self.layout = QtGui.QGridLayout(Dialog) self.urlLabel = QtGui.QLabel('URL :', Dialog) self.layout.addWidget(self.urlLabel, 0, 0, 1, 1) self.urlBox = UrlBox(Dialog) self.layout.addWidget(self.urlBox, 0, 1, 1, 5) # Create Tab Widget self.tabWidget = QtGui.QTabWidget(Dialog) self.tabWidget.setDocumentMode(True) self.tabWidget.tabBar().setExpanding(True) # Add Bookmarks Table self.bookmarks_table = BookmarksTable(Dialog, bookmark_data, True) self.tabWidget.addTab(self.bookmarks_table, 'Bookmarks') # Add Favourites table self.favs_table = BookmarksTable(Dialog, favourites) self.tabWidget.addTab(self.favs_table, 'HomePage Favourites') self.layout.addWidget(self.tabWidget, 1, 0, 1, 6) self.tabWidget.setTabIcon(0, QtGui.QIcon(':/bookmarks.png')) self.tabWidget.setTabIcon(1, QtGui.QIcon(':/favourites.png')) # Add Buttons self.moveUpBtn = QtGui.QPushButton(QtGui.QIcon(":/go-up.png"), '', Dialog) self.moveUpBtn.clicked.connect(self.moveItemUp) self.layout.addWidget(self.moveUpBtn, 2, 0, 1, 1) self.moveDownBtn = QtGui.QPushButton(QtGui.QIcon(":/go-down.png"), '', Dialog) self.moveDownBtn.clicked.connect(self.moveItemDown) self.layout.addWidget(self.moveDownBtn, 2, 1, 1, 1) self.copyLinkBtn = QtGui.QPushButton(QtGui.QIcon(":/edit-copy.png"), '', Dialog) self.copyLinkBtn.clicked.connect(self.copyItemLink) self.layout.addWidget(self.copyLinkBtn, 2, 2, 1, 1) self.editBtn = QtGui.QPushButton(QtGui.QIcon(":/edit.png"), '', Dialog) self.editBtn.clicked.connect(self.editItem) self.layout.addWidget(self.editBtn, 2, 3, 1, 1) self.deleteBtn = QtGui.QPushButton(QtGui.QIcon(":/edit-delete.png"), '', Dialog) self.deleteBtn.clicked.connect(self.deleteItem) self.layout.addWidget(self.deleteBtn, 2, 4, 1, 1) # Add ButtonBox self.buttonBox = QtGui.QDialogButtonBox(Dialog) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Close) self.layout.addWidget(self.buttonBox, 2, 5, 1, 1) self.bookmarks_table.urlSelected.connect(self.urlBox.setText) self.bookmarks_table.doubleclicked.connect(Dialog.accept) self.bookmarks_table.itemSelectionChanged.connect(self.toggleButtonAccess) self.favs_table.doubleclicked.connect(Dialog.accept) self.favs_table.urlSelected.connect(self.urlBox.setText) self.favs_table.itemSelectionChanged.connect(self.toggleButtonAccess) self.tabWidget.currentChanged.connect(self.toggleButtonAccess) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject) self.bookmarks_table.selectRow(0) self.bookmarks_table.setFocus()
def setupUi(self, Dialog): Dialog.setObjectName(_fromUtf8("Dialog")) Dialog.resize(342, 114) Dialog.setWindowTitle(_fromUtf8("")) self.verticalLayout = QtGui.QVBoxLayout(Dialog) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setSizeConstraint(QtGui.QLayout.SetDefaultConstraint) self.horizontalLayout.setMargin(0) self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) self.label_nombre = QtGui.QLabel(Dialog) self.label_nombre.setObjectName(_fromUtf8("label_nombre")) self.horizontalLayout.addWidget(self.label_nombre) self.lineedit_project_name = QtGui.QLineEdit(Dialog) self.lineedit_project_name.setObjectName(_fromUtf8("lineedit_project_name")) self.horizontalLayout.addWidget(self.lineedit_project_name) self.label_group = QtGui.QLabel(Dialog) self.label_group.setObjectName(_fromUtf8("label_group")) self.horizontalLayout.addWidget(self.label_group) self.combobox_term_group = QtGui.QComboBox(Dialog) self.combobox_term_group.setObjectName(_fromUtf8("combobox_term_group")) self.horizontalLayout.addWidget(self.combobox_term_group) self.verticalLayout.addLayout(self.horizontalLayout) self.horizontalLayout_2 = QtGui.QHBoxLayout() self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2")) self.label = QtGui.QLabel(Dialog) self.label.setObjectName(_fromUtf8("label")) self.horizontalLayout_2.addWidget(self.label) self.lineedit_log_path = QtGui.QLineEdit(Dialog) self.lineedit_log_path.setMouseTracking(True) self.lineedit_log_path.setAutoFillBackground(True) self.lineedit_log_path.setReadOnly(True) self.lineedit_log_path.setObjectName(_fromUtf8("lineedit_log_path")) self.horizontalLayout_2.addWidget(self.lineedit_log_path) self.button_log_path = QtGui.QPushButton(Dialog) self.button_log_path.setObjectName(_fromUtf8("button_log_path")) self.horizontalLayout_2.addWidget(self.button_log_path) self.verticalLayout.addLayout(self.horizontalLayout_2) self.buttonBox = QtGui.QDialogButtonBox(Dialog) self.buttonBox.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates)) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName(_fromUtf8("buttonBox")) self.verticalLayout.addWidget(self.buttonBox) self.retranslateUi(Dialog) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("accepted()")), Dialog.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL(_fromUtf8("rejected()")), Dialog.reject) QtCore.QMetaObject.connectSlotsByName(Dialog)
def setupUi(self, HexDialogInsert): HexDialogInsert.setObjectName("HexDialogInsert") HexDialogInsert.resize(404, 146) self.verticalLayout = QtGui.QVBoxLayout(HexDialogInsert) self.verticalLayout.setObjectName("verticalLayout") self.widget = QtGui.QWidget(HexDialogInsert) self.widget.setObjectName("widget") self.horizontalLayout = QtGui.QHBoxLayout(self.widget) self.horizontalLayout.setObjectName("horizontalLayout") self.radioHex = QtGui.QRadioButton(self.widget) self.radioHex.setObjectName("radioHex") self.horizontalLayout.addWidget(self.radioHex) self.lblhex = QtGui.QLabel(self.widget) self.lblhex.setObjectName("lblhex") self.horizontalLayout.addWidget(self.lblhex) self.lineHex = QtGui.QLineEdit(self.widget) self.lineHex.setObjectName("lineHex") self.horizontalLayout.addWidget(self.lineHex) self.verticalLayout.addWidget(self.widget) self.widget_2 = QtGui.QWidget(HexDialogInsert) self.widget_2.setObjectName("widget_2") self.horizontalLayout_2 = QtGui.QHBoxLayout(self.widget_2) self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.radioText = QtGui.QRadioButton(self.widget_2) self.radioText.setChecked(True) self.radioText.setObjectName("radioText") self.horizontalLayout_2.addWidget(self.radioText) self.lbltxt = QtGui.QLabel(self.widget_2) self.lbltxt.setObjectName("lbltxt") self.horizontalLayout_2.addWidget(self.lbltxt) self.lineText = QtGui.QLineEdit(self.widget_2) self.lineText.setObjectName("lineText") self.horizontalLayout_2.addWidget(self.lineText) self.verticalLayout.addWidget(self.widget_2) self.buttonBox = QtGui.QDialogButtonBox(HexDialogInsert) 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(HexDialogInsert) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), HexDialogInsert.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), HexDialogInsert.reject) QtCore.QMetaObject.connectSlotsByName(HexDialogInsert)