我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用PySide.QtGui.QGridLayout()。
def __init__(self, data, low_freq, high_freq, spacing, delay=.01, parent=None): QtGui.QWidget.__init__(self, parent) self._low_freq = low_freq self._high_freq = high_freq self._spacing = spacing self._delay= delay self._data = self._open_data(data) self.render_area = RenderArea(self._data, low_freq, high_freq, spacing, delay) main_layout = QtGui.QGridLayout() main_layout.setContentsMargins(0, 0, 0, 0) main_layout.addWidget(self.render_area, 0, 0) self.setLayout(main_layout) self.setWindowTitle("RfCat Spectrum Analyzer (thanks Ubertooth!)")
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, parent=None): QtGui.QWidget.__init__(self, parent) self.form = self self.form.setWindowTitle(u"Create drill center") self.form.setWindowIcon(QtGui.QIcon(":/data/img/drill-icon.png")) # self.holeSize = QtGui.QDoubleSpinBox() self.holeSize.setValue(0.4) self.holeSize.setMinimum(0.1) self.holeSize.setSuffix('mm') self.holeSize.setSingleStep(0.1) # self.pcbColor = kolorWarstwy() self.pcbColor.setColor(getFromSettings_Color_1('CenterDrillColor', 4294967295)) self.pcbColor.setToolTip(u"Click to change color") # lay = QtGui.QGridLayout(self) lay.addWidget(QtGui.QLabel('Hole size'), 0, 0, 1, 1) lay.addWidget(self.holeSize, 0, 1, 1, 1) lay.addWidget(QtGui.QLabel(u'Color:'), 1, 0, 1, 1) lay.addWidget(self.pcbColor, 1, 1, 1, 1)
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, parent=None, win=None, element="", info=()): super(RenameDialog, self).__init__(parent) self.sourceWin = parent self.info = info self.element = element title = "Rename: " + element self.setWindowTitle(title) layout = QtGui.QGridLayout() question = QtGui.QLabel("Please enter new name:") layout.addWidget(question, 0, 0) self.lineEdit = QtGui.QLineEdit() layout.addWidget(self.lineEdit, 0, 1) self.buttonOK = QtGui.QPushButton("OK", self) layout.addWidget(self.buttonOK, 1, 1) self.buttonCancel = QtGui.QPushButton("Cancel", self) layout.addWidget(self.buttonCancel, 1, 0) self.lineEdit.setText(self.element) self.setLayout(layout) self.buttonCancel.clicked.connect(self.cancelClicked) self.buttonOK.clicked.connect(self.okClicked)
def LayoutDesign(self): self.widget = QtGui.QWidget() self.layout = QtGui.QGridLayout(self.widget) self.layout.setSpacing(1) self.layout.setHorizontalSpacing(0) self.layout.setVerticalSpacing(0) self.scroll = QtGui.QScrollArea() self.scroll.setWidgetResizable(True) self.scroll.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.scroll.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) self.scroll.setWidget(self.widget) self.LayoutChangesOnSliceChange(self.Electrode.slices) self.layout.addWidget(self.CustomWebView, 1, 0,1,25, QtCore.Qt.AlignLeft) self.layout.setContentsMargins(0, 0, 0, 0) self.setContentsMargins(0, 0, 0, 0) self.grid1 = QtGui.QGridLayout() self.grid1.addWidget(self.scroll,3,0) self.setLayout(self.grid1)
def initUI(self): self._mainMenu = MainMenu(self) self._layout = QtGui.QGridLayout() self.setLayout(self._layout) self._layout.setContentsMargins(0,0,0,0) self._layout.setSpacing(0) self._toolBar = QPanelToolBar() self._layout.addWidget(self._toolBar,1,0,1,1) self._layout.addWidget(self._mainMenu,0,0,1,2) #pan = QSplittedPanel() #pan = panel.JobPanel.JobPanel() pan = panel.NodePanel.NodePanel() self._layout.addWidget(pan,1,1)
def createLayout(self, elementList): grid = QtGui.QGridLayout() for element in elementList: name = element["name"] pos = element["position"] arg = element["arg"] widget_parent_name = element["parent"] widget_parent = self.container # default if (widget_parent_name != "None"): widget_parent = self.elements[widget_parent_name] widget = element["type"](*arg) widget.setParent(widget_parent) self.elements[name] = widget grid.addWidget(widget, pos[0], pos[1], pos[ 2], pos[3]) self.container.setLayout(grid) self.setCentralWidget(self.container)
def init_params(self): QtGui.QWidget().setLayout(self.params_vbox) parts_vbox = QtGui.QGridLayout(self.params_widget) self.hide_button = QtGui.QPushButton('Hide others', self.params_widget) parts_vbox.addWidget(self.hide_button, 0, 0) self.hide_button.clicked.connect(self.hide_others) self.show_button = QtGui.QPushButton('Show all', self.params_widget) parts_vbox.addWidget(self.show_button, 0, 1) self.show_button.clicked.connect(self.show_initial_objects) self.set_transparency_button = QtGui.QPushButton('Set transparent', self.params_widget) parts_vbox.addWidget(self.set_transparency_button, 1, 0) self.set_transparency_button.clicked.connect(self.set_transparency) self.reset_transparency_button = QtGui.QPushButton('Restore transparent', self.params_widget) parts_vbox.addWidget(self.reset_transparency_button, 1, 1) self.reset_transparency_button.clicked.connect(self.restore_transparency) preview_button = QtGui.QPushButton('Preview', self.params_widget) parts_vbox.addWidget(preview_button,2,0,1,2) preview_button.clicked.connect(self.preview)
def __init__(self, parent=None, win=None, xrefs_list=None, path="", method=""): super(XrefDialog, self).__init__(parent) if not isinstance(xrefs_list, list) or len(xrefs_list) == 0: androconf.warning("Bad XrefDialog creation") return if not method: title = "Xrefs to %s" % path.split("/")[-1] else: title = "Xrefs to %s -> %s" % (path.split("/")[-1], method) self.setWindowTitle(title) layout = QtGui.QGridLayout() xrefwin = XrefListView(self, win=win, xrefs=xrefs_list) layout.addWidget(xrefwin, 0, 0) self.setLayout(layout)
def __init__(self, data, low_freq, high_freq, spacing, delay=.01, parent=None): QtGui.QWidget.__init__(self, parent) self._low_freq = low_freq self._high_freq = high_freq self._spacing = spacing self._data = self._open_data(data) self.render_area = RenderArea(self._data, low_freq, high_freq, spacing, delay) main_layout = QtGui.QGridLayout() main_layout.setContentsMargins(0, 0, 0, 0) main_layout.addWidget(self.render_area, 0, 0) self.setLayout(main_layout) self.setWindowTitle("RfCat Spectrum Analyzer (thanks Ubertooth!)")
def build_ui(self): grid = QtGui.QGridLayout() grid.setVerticalSpacing(1) grid.setHorizontalSpacing(2) scale = 2 for row_num, line in enumerate(self.keyboard_grid): col_index = 0 for letter, width, button_type in line: key = button_type(letter) key.KEY_CLICKED.connect(self.button_press) if letter == "": key = QtGui.QLabel("") grid.addWidget(key, row_num, col_index, 1, width * scale) col_index += width * scale if letter not in self.key_map: self.key_map[letter] = [] self.key_map[letter].append(weakref.ref(key)) self.setLayout(grid) self.setWindowTitle('Calculator') self.resize(650, 200)
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(529, 329) self.selInfoWidget = QtGui.QWidget(Form) self.selInfoWidget.setGeometry(QtCore.QRect(260, 10, 264, 222)) self.selInfoWidget.setObjectName("selInfoWidget") self.gridLayout = QtGui.QGridLayout(self.selInfoWidget) self.gridLayout.setContentsMargins(0, 0, 0, 0) self.gridLayout.setObjectName("gridLayout") self.selDescLabel = QtGui.QLabel(self.selInfoWidget) self.selDescLabel.setText("") self.selDescLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop) self.selDescLabel.setWordWrap(True) self.selDescLabel.setObjectName("selDescLabel") self.gridLayout.addWidget(self.selDescLabel, 0, 0, 1, 1) self.selNameLabel = QtGui.QLabel(self.selInfoWidget) font = QtGui.QFont() font.setWeight(75) font.setBold(True) self.selNameLabel.setFont(font) self.selNameLabel.setText("") self.selNameLabel.setObjectName("selNameLabel") self.gridLayout.addWidget(self.selNameLabel, 0, 1, 1, 1) self.selectedTree = DataTreeWidget(self.selInfoWidget) self.selectedTree.setObjectName("selectedTree") self.selectedTree.headerItem().setText(0, "1") self.gridLayout.addWidget(self.selectedTree, 1, 0, 1, 2) self.hoverText = QtGui.QTextEdit(Form) self.hoverText.setGeometry(QtCore.QRect(0, 240, 521, 81)) self.hoverText.setObjectName("hoverText") self.view = FlowchartGraphicsView(Form) self.view.setGeometry(QtCore.QRect(0, 0, 256, 192)) self.view.setObjectName("view") self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form)
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(241, 367) self.gridLayout = QtGui.QGridLayout(Form) self.gridLayout.setSpacing(0) self.gridLayout.setObjectName("gridLayout") self.label = QtGui.QLabel(Form) self.label.setObjectName("label") self.gridLayout.addWidget(self.label, 0, 0, 1, 3) self.itemTree = QtGui.QTreeWidget(Form) self.itemTree.setObjectName("itemTree") self.itemTree.headerItem().setText(0, "1") self.itemTree.header().setVisible(False) self.gridLayout.addWidget(self.itemTree, 1, 0, 1, 3) self.label_2 = QtGui.QLabel(Form) self.label_2.setObjectName("label_2") self.gridLayout.addWidget(self.label_2, 2, 0, 1, 3) self.formatList = QtGui.QListWidget(Form) self.formatList.setObjectName("formatList") self.gridLayout.addWidget(self.formatList, 3, 0, 1, 3) self.exportBtn = QtGui.QPushButton(Form) self.exportBtn.setObjectName("exportBtn") self.gridLayout.addWidget(self.exportBtn, 6, 1, 1, 1) self.closeBtn = QtGui.QPushButton(Form) self.closeBtn.setObjectName("closeBtn") self.gridLayout.addWidget(self.closeBtn, 6, 2, 1, 1) self.paramTree = ParameterTree(Form) self.paramTree.setObjectName("paramTree") self.paramTree.headerItem().setText(0, "1") self.paramTree.header().setVisible(False) self.gridLayout.addWidget(self.paramTree, 5, 0, 1, 3) self.label_3 = QtGui.QLabel(Form) self.label_3.setObjectName("label_3") self.gridLayout.addWidget(self.label_3, 4, 0, 1, 3) self.copyBtn = QtGui.QPushButton(Form) self.copyBtn.setObjectName("copyBtn") self.gridLayout.addWidget(self.copyBtn, 6, 0, 1, 1) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form)
def setupUi(self, sonosConnect): sonosConnect.setObjectName("sonosConnect") self.gridLayout = QtGui.QGridLayout(sonosConnect) self.connectList = QtGui.QListWidget(sonosConnect) QtGui.QListWidgetItem(self.connectList) self.gridLayout.addWidget(self.connectList, 0, 0, 1, 3) self.checkBox = QtGui.QCheckBox(sonosConnect) self.gridLayout.addWidget(self.checkBox, 2, 0, 1, 1) self.connectButton = QtGui.QPushButton(sonosConnect) self.gridLayout.addWidget(self.connectButton, 2, 2, 1, 1) self.rescanButton = QtGui.QPushButton(sonosConnect) self.gridLayout.addWidget(self.rescanButton, 2, 1, 1, 1) self.retranslateUi(sonosConnect) QtCore.QMetaObject.connectSlotsByName(sonosConnect)
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 formatPliku(self): page = QtGui.QWizardPage() page.setSubTitle(u"<span style='font-weight:bold;font-size:13px;'>File format</span>") # self.nazwaProgramu = QtGui.QLabel() self.formatPliku = QtGui.QLabel() self.ikonaProgramu = QtGui.QLabel() self.ikonaProgramu.setFixedSize(120, 120) self.ikonaProgramu.setAlignment(QtCore.Qt.AlignCenter) # self.listaFormatow = QtGui.QListWidget() for i, j in supSoftware.items(): if j['export']: a = QtGui.QListWidgetItem(j['name']) a.setData(QtCore.Qt.UserRole, i) self.listaFormatow.addItem(a) QtCore.QObject.connect(self.listaFormatow, QtCore.SIGNAL("currentRowChanged (int)"), self.zmianaProgramu) # lay = QtGui.QGridLayout(page) lay.addWidget(self.listaFormatow, 0, 0, 4, 1) lay.addWidget(self.ikonaProgramu, 0, 1, 1, 1, QtCore.Qt.AlignCenter) lay.addWidget(self.nazwaProgramu, 1, 1, 1, 1) lay.addWidget(self.formatPliku, 2, 1, 1, 1) lay.setHorizontalSpacing(20) lay.setColumnMinimumWidth(1, 140) return page
def exportUstawienia(self): page = QtGui.QWizardPage() page.setSubTitle(u"<span style='font-weight:bold;font-size:13px;'>Settings</span>") # self.pathToFile = QtGui.QLineEdit('') #self.pathToFile.setReadOnly(True) # zmianaSciezki = QtGui.QPushButton('...') zmianaSciezki.setToolTip(u'Change path') QtCore.QObject.connect(zmianaSciezki, QtCore.SIGNAL("pressed ()"), self.zmianaSciezkiF) # self.addHoles = QtGui.QCheckBox(u'Add holes') self.addDimensions = QtGui.QCheckBox(u'Add dimensions') self.addAnnotations = QtGui.QCheckBox(u'Add annotations') self.addGluePaths = QtGui.QCheckBox(u'Export glue paths') # lay = QtGui.QGridLayout(page) lay.addWidget(QtGui.QLabel(u'Path: '), 0, 0, 1, 1) lay.addWidget(self.pathToFile, 0, 1, 1, 1) lay.addWidget(zmianaSciezki, 0, 2, 1, 1) lay.addItem(QtGui.QSpacerItem(1, 10), 1, 0, 1, 3) lay.addWidget(self.addHoles, 2, 0, 1, 3) lay.addWidget(self.addDimensions, 3, 0, 1, 3) lay.addWidget(self.addAnnotations, 4, 0, 1, 3) lay.addWidget(self.addGluePaths, 5, 0, 1, 3) lay.setColumnStretch(1, 6) return page
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) # self.form = self self.form.setWindowTitle(u'Check collisions') self.form.setWindowIcon(QtGui.QIcon(":/data/img/collisions.png")) self.root = None self.obj = None self.tmpFile = None self.transaprency = {} # self.createSolid = QtGui.QCheckBox(u'Create solid on exit') # self.table1 = collisionObjectTable() # self.table2 = collisionObjectTable() # checkButton = QtGui.QPushButton(u"Check") self.connect(checkButton, QtCore.SIGNAL("released ()"), self.preview) # lay = QtGui.QGridLayout(self) lay.addWidget(checkButton, 0, 0, 1, 2) lay.addWidget(QtGui.QLabel(u'First group'), 1, 0, 1, 1) lay.addWidget(self.table1, 2, 0, 1, 1) lay.addWidget(QtGui.QLabel(u'Second group'), 1, 1, 1, 1) lay.addWidget(self.table2, 2, 1, 1, 1) lay.addWidget(self.createSolid, 3, 0, 1, 2) # self.readObjects() self.removeRoot()
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 __init__(self, searchPhrase=None, parent=None): QtGui.QWidget.__init__(self, parent) # self.form = self self.form.setWindowIcon(QtGui.QIcon(":/data/img/downloadModel.png")) # if searchPhrase: self.form.setWindowTitle('Download model for {0}'.format(searchPhrase)) url_1 = odnosnik("<a href='http://sourceforge.net/projects/eaglepcb2freecad/files/models/'>FreeCAD-PCB</a>") url_2 = odnosnik("<a href='http://www.tracepartsonline.net/(S(q4odzm45rnnypc4513kjgy45))/content.aspx?SKeywords={0}'>trace<b>parts</b></a>".format(searchPhrase)) url_3 = odnosnik("<a href='http://www.3dcontentcentral.com/Search.aspx?arg={0}'>3D ContentCentral</a>".format(searchPhrase)) else: self.form.setWindowTitle('Download model') url_1 = odnosnik("<a href='http://sourceforge.net/projects/eaglepcb2freecad/files/models/'>FreeCAD-PCB</a>") url_2 = odnosnik("<a href='http://www.tracepartsonline.net/(S(q4odzm45rnnypc4513kjgy45))/content.aspx'>trace<b>parts</b></a>") url_3 = odnosnik("<a href='http://www.3dcontentcentral.com/'>3D ContentCentral</a>") # lay = QtGui.QGridLayout(self) lay.addWidget(dodatkowaIkonka_lista(), 0, 0, 1, 1) lay.addWidget(url_1, 0, 1, 1, 1) lay.addWidget(dodatkowaIkonka_lista(), 1, 0, 1, 1) lay.addWidget(url_2, 1, 1, 1, 1) lay.addWidget(dodatkowaIkonka_klucz(), 1, 2, 1, 1) lay.addWidget(dodatkowaIkonka_lista(), 2, 0, 1, 1) lay.addWidget(url_3, 2, 1, 1, 1) lay.addWidget(dodatkowaIkonka_klucz(), 2, 2, 1, 1) lay.addItem(QtGui.QSpacerItem(5, 20), 3, 0, 1, 3) lay.addWidget(QtGui.QLabel('Printed Circuit Board supported formats: IGS, STEP'), 3, 0, 1, 3) lay.setColumnStretch(1, 10)
def defConstraintAreaF(self): ''' create constraint are dialog ''' dial = QtGui.QDialog() dial.setWindowTitle("Create constraint area") # areas list lista = QtGui.QListWidget() for i, j in PCBconstraintAreas.items(): a = QtGui.QListWidgetItem(j[0]) a.setData(QtCore.Qt.UserRole, i) lista.addItem(a) lista.sortItems() ########## # przyciski buttons = QtGui.QDialogButtonBox() buttons.setOrientation(QtCore.Qt.Vertical) buttons.addButton("Cancel", QtGui.QDialogButtonBox.RejectRole) buttons.addButton("Create", QtGui.QDialogButtonBox.AcceptRole) dial.connect(buttons, QtCore.SIGNAL("accepted()"), dial, QtCore.SLOT("accept()")) dial.connect(buttons, QtCore.SIGNAL("rejected()"), dial, QtCore.SLOT("reject()")) #### lay = QtGui.QGridLayout() lay.addWidget(lista, 0, 0, 1, 1) lay.addWidget(buttons, 0, 1, 1, 1) dial.setLayout(lay) if dial.exec_(): self.constraintAreaF(str(lista.currentItem().data(QtCore.Qt.UserRole)))
def _add_pane_3(self): """ Add pane 3, an intermediate pane while we are sampling the posterior. """ self.p3 = QtGui.QWidget() self.layout.addWidget(self.p3) # Pane 3 p3_layout = QtGui.QGridLayout() self.p3.setLayout(p3_layout) p3_layout.addItem(QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding), 0, 1, 1, 1) self.p3_progressbar = QtGui.QProgressBar(self) self.p3_progressbar.setFocusPolicy(QtCore.Qt.NoFocus) p3_layout.addWidget(self.p3_progressbar, 2, 1, 1, 1) p3_layout.addItem(QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum), 2, 2, 1, 1) p3_layout.addItem(QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum), 2, 0, 1, 1) self.p3_label = QtGui.QLabel(self) self.p3_label.setText("Sampling posterior") self.p3_label.setAlignment(QtCore.Qt.AlignCenter) p3_layout.addWidget(self.p3_label, 1, 1, 1, 1) p3_layout.addItem(QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding), 3, 1, 1, 1) return None
def __init__(self, parent=None, win=None, current_class=None, class_analysis=None): super(XrefDialogClass, self).__init__(parent) self.current_class = current_class self.class_analysis = class_analysis title = "Xrefs for the class %s" % current_class self.setWindowTitle(title) xrefs_list = [] ref_kind_map = {0:"Class instanciation", 1:"Class reference"} xrefs_from = class_analysis.get_xref_from() for ref_class in xrefs_from: for ref_kind, ref_method in xrefs_from[ref_class]: xrefs_list.append(('From', ref_kind_map[ref_kind], ref_method, ref_class.get_vm_class())) xrefs_to = class_analysis.get_xref_to() for ref_class in xrefs_to: for ref_kind, ref_method in xrefs_to[ref_class]: xrefs_list.append(('To', ref_kind_map[ref_kind], ref_method, ref_class.get_vm_class())) closeButton = QtGui.QPushButton("Close") closeButton.clicked.connect(self.close) xreflayout = QtGui.QGridLayout() xrefwin = XrefListView(self, win=win, xrefs=xrefs_list, headers=["Origin", "Kind", "Method"]) xreflayout.addWidget(xrefwin, 0, 0) buttonsLayout = QtGui.QHBoxLayout() buttonsLayout.addStretch(1) buttonsLayout.addWidget(closeButton) mainLayout = QtGui.QVBoxLayout() mainLayout.addLayout(xreflayout) mainLayout.addLayout(buttonsLayout) self.setLayout(mainLayout)
def __init__(self, parent=None, win=None, current_class=None, class_analysis=None, method_analysis=None): super(XrefDialogMethod, self).__init__(parent) self.current_class = current_class self.class_analysis = class_analysis self.method_analysis = method_analysis title = "Xrefs for the method %s" % self.method_analysis.method self.setWindowTitle(title) xrefs_list = [] xrefs_from = self.method_analysis.get_xref_from() for ref_class, ref_method in xrefs_from: xrefs_list.append(('From', ref_method, ref_class.get_vm_class())) xrefs_to = self.method_analysis.get_xref_to() for ref_class, ref_method in xrefs_to: xrefs_list.append(('To', ref_method, ref_class.get_vm_class())) closeButton = QtGui.QPushButton("Close") closeButton.clicked.connect(self.close) xreflayout = QtGui.QGridLayout() xrefwin = XrefListView(self, win=win, xrefs=xrefs_list) xreflayout.addWidget(xrefwin, 0, 0) buttonsLayout = QtGui.QHBoxLayout() buttonsLayout.addStretch(1) buttonsLayout.addWidget(closeButton) mainLayout = QtGui.QVBoxLayout() mainLayout.addLayout(xreflayout) mainLayout.addLayout(buttonsLayout) self.setLayout(mainLayout)
def __init__(self, parent=None, win=None, current_class=None, class_analysis=None, field_analysis=None): super(XrefDialogField, self).__init__(parent) self.current_class = current_class self.class_analysis = class_analysis self.field_analysis = field_analysis title = "Xrefs for the field %s" % self.field_analysis.field self.setWindowTitle(title) xrefs_list = [] xrefs_read = self.field_analysis.get_xref_read() for ref_class, ref_method in xrefs_read: xrefs_list.append(('Read', ref_method, ref_class.get_vm_class())) xrefs_write = self.field_analysis.get_xref_write() for ref_class, ref_method in xrefs_write: xrefs_list.append(('Write', ref_method, ref_class.get_vm_class())) closeButton = QtGui.QPushButton("Close") closeButton.clicked.connect(self.close) xreflayout = QtGui.QGridLayout() xrefwin = XrefListView(self, win=win, xrefs=xrefs_list) xreflayout.addWidget(xrefwin, 0, 0) buttonsLayout = QtGui.QHBoxLayout() buttonsLayout.addStretch(1) buttonsLayout.addWidget(closeButton) mainLayout = QtGui.QVBoxLayout() mainLayout.addLayout(xreflayout) mainLayout.addLayout(buttonsLayout) self.setLayout(mainLayout)
def __init__(self, parent=None, win=None, string_analysis=None): super(XrefDialogString, self).__init__(parent) self.string_analysis = string_analysis title = "Xrefs for the string %s" % self.string_analysis.value self.setWindowTitle(title) xrefs_list = [] xrefs_from = self.string_analysis.get_xref_from() for ref_class, ref_method in xrefs_from: xrefs_list.append(('From', ref_method, ref_class.get_vm_class())) closeButton = QtGui.QPushButton("Close") closeButton.clicked.connect(self.close) xreflayout = QtGui.QGridLayout() xrefwin = XrefListView(self, win=win, xrefs=xrefs_list) xreflayout.addWidget(xrefwin, 0, 0) buttonsLayout = QtGui.QHBoxLayout() buttonsLayout.addStretch(1) buttonsLayout.addWidget(closeButton) mainLayout = QtGui.QVBoxLayout() mainLayout.addLayout(xreflayout) mainLayout.addLayout(buttonsLayout) self.setLayout(mainLayout)
def create_layout(self, settings, cols=3): glayout = QtGui.QGridLayout() glayout.setContentsMargins(10, 15, 10, 5) glayout.setAlignment(QtCore.Qt.AlignTop) glayout.setSpacing(10) glayout.setHorizontalSpacing(20) col = 0 row = 0 for setting_name in settings: setting = self.get_setting(setting_name) if col >= cols*2: row += 1 col = 0 display_name = setting.display_name+':' if setting.required: display_name += '*' setting_label = QtGui.QLabel(display_name) setting_label.setToolTip(setting.description) setting_label.setStatusTip(setting.description) glayout.addWidget(setting_label, row, col) sett = self.create_setting(setting_name) glayout.addLayout(sett, row, col+1) col += 2 return glayout
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, PushGridWidget): PushGridWidget.setObjectName("PushGridWidget") PushGridWidget.resize(302, 203) self.gridLayoutWidget_2 = QtGui.QWidget(PushGridWidget) self.gridLayoutWidget_2.setGeometry(QtCore.QRect(0, 0, 301, 201)) self.gridLayoutWidget_2.setObjectName("gridLayoutWidget_2") self.pushGrid = QtGui.QGridLayout(self.gridLayoutWidget_2) self.pushGrid.setContentsMargins(0, 0, 0, 0) self.pushGrid.setObjectName("pushGrid") self.listViewLeft = QtGui.QListView(self.gridLayoutWidget_2) self.listViewLeft.setObjectName("listViewLeft") self.pushGrid.addWidget(self.listViewLeft, 0, 0, 1, 1) self.listViewRight = QtGui.QListView(self.gridLayoutWidget_2) self.listViewRight.setObjectName("listViewRight") self.pushGrid.addWidget(self.listViewRight, 0, 2, 1, 1) self.btnGrid = QtGui.QGridLayout() self.btnGrid.setObjectName("btnGrid") self.btnPushRight = QtGui.QPushButton(self.gridLayoutWidget_2) self.btnPushRight.setObjectName("btnPushRight") self.btnGrid.addWidget(self.btnPushRight, 0, 0, 1, 1) self.btnPushLeft = QtGui.QPushButton(self.gridLayoutWidget_2) self.btnPushLeft.setObjectName("btnPushLeft") self.btnGrid.addWidget(self.btnPushLeft, 1, 0, 1, 1) self.pushGrid.addLayout(self.btnGrid, 0, 1, 1, 1) self.retranslateUi(PushGridWidget) QtCore.QMetaObject.connectSlotsByName(PushGridWidget)
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, ViewDialog): ViewDialog.setObjectName("ViewDialog") ViewDialog.resize(640, 480) self.gridLayout = QtGui.QGridLayout(ViewDialog) self.gridLayout.setSpacing(0) self.gridLayout.setContentsMargins(0, 0, 0, 0) self.gridLayout.setObjectName("gridLayout") self.view = ViewWidget(ViewDialog) self.view.setMaximumSize(QtCore.QSize(16777214, 16777214)) self.view.setObjectName("view") self.gridLayout.addWidget(self.view, 0, 0, 1, 1) self.retranslateUi(ViewDialog) QtCore.QMetaObject.connectSlotsByName(ViewDialog)
def initUI(self): self.layout = QtGui.QGridLayout() self.setLayout(self.layout) button = QtGui.QPushButton("Render") self.layout.addWidget(button,1,0)
def initUI(self): self.layout = QtGui.QGridLayout() self.setLayout(self.layout) self.layout.setContentsMargins(0,0,0,0) self.releaseTypeLabel = QtGui.QLabel("Release Type :") self.releaseType = QtGui.QComboBox() self.releaseType.addItems(["2D","3D"]) self.releaseType.currentIndexChanged.connect(self.currentIndexChanged) self.layout.addWidget(self.releaseTypeLabel,1,0) self.layout.addWidget(self.releaseType,1,2,1,2) a = QtGui.QListWidget() b = QtGui.QListWidget() self.elementForm() self.tab = QtGui.QTabWidget() self.tab.addTab(self.elementFormWidget,"Element") self.tab.addTab(b,"Email") #gesw = self.generateElementSelectionWidget() self.layout.addWidget(self.tab,2,0,10,4) self.elementFormLayout.addWidget(self.backButton,11,2) self.elementFormLayout.addWidget(self.nextButton,11,3)
def elementForm(self): self.elementFormWidget = QtGui.QWidget() self.elementFormLayout = QtGui.QGridLayout() self.elementFormWidget.setLayout(self.elementFormLayout) self.showList=QtGui.QComboBox() self.sqList=QtGui.QComboBox() self.shotList=QtGui.QComboBox() self.taskList=QtGui.QComboBox() self.userFilterLabel = QtGui.QLabel("User Filter") self.userFilter = QtGui.QLineEdit(str(os.getenv("USER"))) self.renderList = QtGui.QListWidget() self.renderList.setSelectionMode(QtGui.QAbstractItemView.MultiSelection) self.generateList() self.backButton=QtGui.QPushButton("Back") self.nextButton=QtGui.QPushButton("Next") self.elementFormLayout.addWidget(self.showList,4,0) self.elementFormLayout.addWidget(self.sqList,4,1) self.elementFormLayout.addWidget(self.shotList,4,2) self.elementFormLayout.addWidget(self.taskList,4,3) self.elementFormLayout.addWidget(self.userFilterLabel,7,0) self.elementFormLayout.addWidget(self.userFilter,7,1,1,3) self.elementFormLayout.addWidget(self.renderList,6,0,1,4)
def initUI(self): self.layout = QtGui.QGridLayout() self.setLayout(self.layout) self.combo = QtGui.QComboBox() self.combo.addItems(["Files","Stats","Custom"]) self.combo.currentIndexChanged.connect(self.currentIndexChanged) self.layout.addWidget(self.combo)
def _initUI(self): self._layout = QtGui.QGridLayout(None) self.setLayout(self._layout) self._layout.setContentsMargins(0,0,0,0) self._menu = QtGui.QMenuBar(self) self._menu.setNativeMenuBar(False) _menuFile = self._menu.addMenu("File") _menuFile.addAction("Open...") _menuFile.addAction("Save") _menuFile.addAction("Save As...") _menuFile.addSeparator() _menuFile.addAction("Execute") _menuFile.addAction("Execute File...") _menuConsole = self._menu.addMenu("Console") _menuConsole.addAction("Show Everything") _menuConsole.addSeparator() _menuConsole.addAction("Show Only Error") _menuConsole.addAction("Show Only Warning") _menuConsole.addAction("Show Only Message") _menuConsole.addSeparator() _menuConsole.addAction("Clear") self._outputConsole = OutputConsole() self._inputConsole = InputConsole() self._layout.addWidget(self._menu,0,0) self._layout.addWidget(self._outputConsole,1,0) self._layout.addWidget(self._inputConsole,2,0)
def initUI(self): self._layout = QtGui.QGridLayout(None) self.setLayout(self._layout) self._layout.setContentsMargins(0,5,0,5) self._layout.setSpacing(0) self._topBar = QtGui.QFrame() self._topBarLayout = QtGui.QHBoxLayout(self._topBar) self._refreshProgression = QtGui.QProgressBar() self._refreshProgression.setMinimum(0) self._refreshProgression.setMaximum(100) self._refreshProgression.setValue(10) self._refreshButton = QtGui.QPushButton("Refresh") self._filterLabel = QtGui.QLabel("Filter :") self._filterField = QtGui.QLineEdit() self._topBarLayout.addWidget(self._refreshProgression) self._topBarLayout.addWidget(self._refreshButton) self._topBarLayout.addWidget(self._filterLabel) self._topBarLayout.addWidget(self._filterField) self.generateJobList() self._layout.addWidget(self._topBar) self._layout.addWidget(self._jobList) self._autoRefresh = JobListAutoRefresh(self,self._refreshProgression) #autoRefresh.run() self._refreshButton.clicked.connect(self.startRefresh)
def initUI(self): self._layout = QtGui.QVBoxLayout() self.setLayout(self._layout) self._layout.setContentsMargins(5,5,5,5) self.headerWidget = HeaderParameterPanel() self._layout.addWidget(self.headerWidget) self.parameterContainerWidget = QtGui.QWidget() self.parameterContainerWidgetLayout = QtGui.QGridLayout() self.parameterContainerWidget.setLayout(self.parameterContainerWidgetLayout) self._layout.addWidget(self.parameterContainerWidget) self._layout.addStretch()