我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用PySide.QtGui.QVBoxLayout()。
def __init__ (self, title, mmax=100) : super (FamilyProgress, self).__init__ () self.setWindowTitle (title) self.setFixedHeight (48) self.pbar = QtGui.QProgressBar () self.pbar.setRange (0, mmax - 1) self.btn = QtGui.QPushButton ("Starting", self) pbarvbox = QtGui.QVBoxLayout() pbarvbox.addStretch (False) pbarvbox.addWidget (self.pbar) buttonvbox = QtGui.QVBoxLayout () buttonvbox.addStretch (True) buttonvbox.addWidget (self.btn) hbox = QtGui.QHBoxLayout () hbox.addLayout(pbarvbox, stretch=False) hbox.addLayout(buttonvbox) self.setLayout (hbox) self.pbar.setStyleSheet(START_STYLE) #self.show()
def setupUi(self): """Bruh""" self.setAttribute(QtCore.Qt.WA_DeleteOnClose) self.setGeometry(50, 50, 600, 300) self.setWindowTitle("ZeZe's TWTools - Backtiming Calculator") self.setWindowIcon(QtGui.QIcon(resource_path("images/icon.png"))) """Background color""" self.backgroundPalette = QtGui.QPalette() self.backgroundColor = QtGui.QColor(217, 204, 170) self.backgroundPalette.setColor( QtGui.QPalette.Background, self.backgroundColor) self.setPalette(self.backgroundPalette) """Main layout & return to main menu button""" self.verticalLayout = QtGui.QVBoxLayout(self) self.buttonLayout = QtGui.QHBoxLayout(self) self.verticalLayout.addLayout(self.buttonLayout) self.returnButton = QtGui.QPushButton(" Return to the Main Menu ", self) self.returnButton.clicked.connect(self.return_function) self.buttonLayout.addWidget(self.returnButton) self.buttonSpacer = QtGui.QSpacerItem(0, 0, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.buttonLayout.addItem(self.buttonSpacer)
def fv(name="vertical",title=''): # w=QtGui.QWidget() t=QtGui.QLabel("my widget") w=MyDockWidget(t,"Reconstruction WB") ### w.setStyleSheet("QWidget { font: bold 18px;color:brown;border-style: outset;border-width: 3px;border-radius: 10px;border-color: blue;}") if title <>'': w.setWindowTitle(title) layout = QtGui.QVBoxLayout() layout.setAlignment(QtCore.Qt.AlignTop) #w.layout=layout #w.setLayout(layout) w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) w.show() # ComboViewShowWidget(w,True) try: FreeCAD.w5.append(w) except: FreeCAD.w5=[w] return w
def fh2(name="vertik horizontal",title=''): w=QtGui.QWidget() #w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) ### w.setStyleSheet("QWidget { font: bold 18px;color:blue;border-style: outset;border-width: 3px;border-radius: 10px;border-color: blue;}") layout = QtGui.QVBoxLayout() layout.setAlignment(QtCore.Qt.AlignLeft) w.setLayout(layout) #pB= QtGui.QLabel("name") #pB.setStyleSheet("QWidget { font: bold 18px;color:red;border-style: outset;border-width: 3px;border-radius: 10px;border-color: blue;}") #layout.addWidget(pB) if title <>'': w.setWindowTitle(title) #w.show() #ComboViewShowWidget(w,False) w.layout=layout return w
def main(): #MaxPlus.FileManager.Reset(True) w = QtGui.QWidget() MaxPlus.AttachQWidgetToMax(w) if _GCProtector.widgets : w = _GCProtector.widgets print w w.resize(250, 100) w.setWindowTitle('Window') _GCProtector.widgets = w w.show() main_layout = QtGui.QVBoxLayout() label = QtGui.QLabel("Click button to create a cylinder in the scene") main_layout.addWidget(label) cylinder_btn = QtGui.QPushButton("Cylinder") main_layout.addWidget(cylinder_btn) w.setLayout(main_layout) cylinder_btn.clicked.connect(make_cylinder)
def __init__(self): super(MatcherUI, self).__init__() self.setWindowTitle("Matcher") self.resize(230, 180) self.layout = QtGui.QVBoxLayout(self) label = QtGui.QLabel("Match attributes\nbetween objects") separator = HSeparator() self.name = QtGui.QCheckBox("Name") self.color = QtGui.QCheckBox("Color") self.position = QtGui.QCheckBox("Position") self.rotation = QtGui.QCheckBox("Rotation") self.ref = QtGui.QCheckBox("Ref") separator2 = HSeparator() self.button = QtGui.QPushButton("Apply") self.layout.addWidget(label) self.layout.addWidget(separator) self.layout.addWidget(self.name) self.layout.addWidget(self.color) self.layout.addWidget(self.position) self.layout.addWidget(self.rotation) self.layout.addWidget(self.ref) self.layout.addWidget(separator2) self.layout.addWidget(self.button)
def initUI(self, title, idGDT, ContainerOfData): self.idGDT = idGDT self.ContainerOfData = ContainerOfData vbox = QtGui.QVBoxLayout() for widg in self.dd_dialogWidgets: if widg <> None: w = widg.generateWidget(self.idGDT,self.ContainerOfData) if isinstance(w, QtGui.QLayout): vbox.addLayout( w ) else: vbox.addWidget( w ) hbox = QtGui.QHBoxLayout() buttonCreate = QtGui.QPushButton(title) buttonCreate.setDefault(True) buttonCreate.clicked.connect(self.createObject) hbox.addStretch(1) hbox.addWidget( buttonCreate ) hbox.addStretch(1) vbox.addLayout( hbox ) self.setLayout(vbox)
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) # self.form = self self.form.setWindowTitle(u"Export to Kerkythea v1.2") # tab = QtGui.QTabWidget() tab.addTab(self.tabGeneral(), u'General') tab.addTab(self.tabCamera(), u'Cameras') tab.addTab(self.tabLight(), u'Lights') # lay = QtGui.QVBoxLayout(self) lay.addWidget(tab) # self.connect(self.exportObjectsAs_YES, QtCore.SIGNAL("clicked ()"), self.setColors) self.connect(self.exportObjectsAs_NO, QtCore.SIGNAL("clicked ()"), self.setColors)
def __init__(self, parent=None, win=None, xrefs=None, headers=["Origin", "Method"]): super(XrefListView, self).__init__(parent) self.parent = parent self.mainwin = win self.xrefs = xrefs self.headers = headers self.setMinimumSize(600, 400) self.filterPatternLineEdit = QtGui.QLineEdit() self.filterPatternLabel = QtGui.QLabel("&Filter origin pattern:") self.filterPatternLabel.setBuddy(self.filterPatternLineEdit) self.filterPatternLineEdit.textChanged.connect(self.filterRegExpChanged) self.xrefwindow = XrefValueWindow(self, win, self.xrefs, self.headers) sourceLayout = QtGui.QVBoxLayout() sourceLayout.addWidget(self.xrefwindow) sourceLayout.addWidget(self.filterPatternLabel) sourceLayout.addWidget(self.filterPatternLineEdit) self.setLayout(sourceLayout)
def MaintainLayout(self): self.InterfaceWidget =QtGui.QWidget() self.InterfaceWidget.setContentsMargins(0, 0, 0, 0) self.InterfaceLayout = QtGui.QVBoxLayout() ConsensusPlot = QtGui.QHBoxLayout() # self.InterfaceLayout.setContentsMargins(0, 0, 0, 0) # self.communitiesAcrossTimeStep.PlotWidget.setMinimumSize(200,100) # self.communitiesAcrossTimeStep.PlotWidget.setMaximumSize(200,100) # ConsensusPlot.addWidget(self.communitiesAcrossTimeStep.PlotWidget) self.InterfaceLayout.addWidget(self.Visualizer.MainTab) self.InterfaceLayout.setContentsMargins(0, 0, 0, 0) self.InterfaceLayout.addLayout(ConsensusPlot) self.InterfaceLayout.setContentsMargins(0, 0, 0, 0) self.InterfaceWidget.setContentsMargins(0, 0, 0, 0) self.InterfaceWidget.setLayout(self.InterfaceLayout) self.InterfaceWidget.setContentsMargins(0, 0, 0, 0) self.InterfaceWidget.show() # def connectCustomWebView(self, view): # self.view = view # self.Visualizer.SliceInterval.valueChanged[int].connect(self.view.slicesChanged)
def __init__(self, AcrossTimestepUI, AcrossTimestepObject): QtGui.QWidget.__init__(self) self.UIWidget = QtGui.QVBoxLayout() self.Widget1 = QtGui.QWidget() self.AcrossTimestepUI = AcrossTimestepUI self.AcrossTimestepObject = AcrossTimestepObject self.defaultValue = "0.3" self.ConnectControls() self.doControls() self.UIWidget.setContentsMargins(0,0,0,0) self.UIWidget.addWidget(self.AcrossTimestepUI) self.UIWidget.setContentsMargins(0,0,0,0) # self.AcrossTimestepUI.thresholdvalue.hide() self.setLayout(self.UIWidget)
def create_icon_box(self, name, text): style = 'width:48px;height:48px;background-color:white;border-radius:5px;border:1px solid rgb(50,50,50);' icon_label = QtGui.QLabel() icon_label.setStyleSheet(style) icon_label.setMaximumWidth(48) icon_label.setMinimumWidth(48) icon_label.setMaximumHeight(48) icon_label.setMinimumHeight(48) setattr(self, name, icon_label) icon_text = QtGui.QLabel(text) icon_text.setStyleSheet('font-size:10px;') icon_text.setAlignment(QtCore.Qt.AlignCenter) vbox = QVBoxLayout() vbox.setAlignment(QtCore.Qt.AlignCenter) vbox.addWidget(icon_label) vbox.addWidget(icon_text) vbox.setContentsMargins(0, 0, 0, 0) w = QtGui.QWidget() w.setLayout(vbox) w.setMaximumWidth(70) return w
def __init__(self, choices, title = "select one from choices", parent = None): super(ChoiceDialog, self).__init__(parent) layout = QVBoxLayout(self) self.choiceButtonGroup=QButtonGroup(parent) # it is not a visible UI self.choiceButtonGroup.setExclusive(True) if choices and len(choices)>=1: self.choices = choices for id, choice in enumerate(self.choices): rb = QRadioButton(choice) self.choiceButtonGroup.addButton(rb) self.choiceButtonGroup.setId(rb, id) # negative id if not specified layout.addWidget(rb) self.choiceButtonGroup.buttonClicked.connect(self.choiceChanged) # OK and Cancel buttons buttons = QDialogButtonBox( QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self) buttons.accepted.connect(self.accept) buttons.rejected.connect(self.reject) layout.addWidget(buttons) self.setLayout(layout) self.setWindowTitle(title)
def __init__(self, sandbox, *args, **kwargs): QtGui.QDockWidget.__init__(self, 'Sources', *args, **kwargs) self.sandbox = sandbox layout = QtGui.QVBoxLayout() layout.setContentsMargins(3, 3, 3, 3) sources = SourcesList(sandbox) sources_add_menu = SourcesAddButton(sandbox) self.setFeatures(QtGui.QDockWidget.DockWidgetFloatable | QtGui.QDockWidget.DockWidgetMovable) self.widget = QtGui.QWidget() self.widget.setLayout(layout) self.widget.layout().addWidget(sources) self.widget.layout().addWidget(sources_add_menu) self.setWidget(self.widget)
def MySaveDialog(target=None): '''widget for save sketch into a file''' lm=getfiles() w=QtGui.QWidget() w.target=target box = QtGui.QVBoxLayout() w.setLayout(box) w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) w.r=QtGui.QPushButton("save selected sketch as file") box.addWidget(w.r) w.r.pressed.connect(lambda :saveSketch(w)) w.show() return w
def dialogV(obj): '''erzeugen dialog vLayout''' w=QtGui.QWidget() box = QtGui.QVBoxLayout() w.setLayout(box) w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) for p in obj.props: pw=createPropWidget( obj,p) box.addWidget(pw) w.r=QtGui.QPushButton("close") box.addWidget(w.r) w.r.pressed.connect(lambda :clear(w)) w.show() return w ##create controller main dialog
def fv3(name="vertical",title=''): ''' vertical layout but not a dock widget''' w=QtGui.QWidget() # w.setStyleSheet("QWidget { font: bold 18px;color:brown;border-style: outset;border-width: 3px;border-radius: 10px;border-color: blue;}") if title <>'': w.setWindowTitle(title) layout = QtGui.QVBoxLayout() layout.setAlignment(QtCore.Qt.AlignTop) #w.layout=layout #w.setLayout(layout) # w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) # w.show() try: FreeCAD.w5.append(w) except: FreeCAD.w5=[w] return w
def init_tree_widget(self): # Add part buttons h_box = QtGui.QHBoxLayout(self.tree_widget) add_parts_button = QtGui.QPushButton('Add parts', self.tree_widget) add_parts_button.clicked.connect(self.add_parts) add_same_part_button = QtGui.QPushButton('Add same parts', self.tree_widget) add_same_part_button.clicked.connect(self.add_same_parts) h_box.addWidget(add_parts_button) h_box.addWidget(add_same_part_button) self.tree_vbox.addLayout(h_box) # tree self.selection_model = self.tree_view_widget.selectionModel() self.selection_model.selectionChanged.connect(self.selection_changed) self.tree_vbox.addWidget(self.tree_view_widget) remove_item_button = QtGui.QPushButton('Remove item', self.tree_widget) remove_item_button.clicked.connect(self.remove_items) self.tree_vbox.addWidget(remove_item_button) # test layout self.edit_items_layout = QtGui.QVBoxLayout(self.tree_widget) self.tree_vbox.addLayout(self.edit_items_layout)
def init_right_pane(self): self.right_pane = QtGui.QVBoxLayout() # RATE button self.rate_btn = QtGui.QPushButton("rate", self) self.rate_btn.clicked.connect(self.rate) self.right_pane.addWidget(self.rate_btn) # OPEN button self.open_btn = QtGui.QPushButton("open", self) self.open_btn.clicked.connect(lambda: webbrowser.open(self.cur_vid)) self.right_pane.addWidget(self.open_btn) # INFO box self.info_box = QtGui.QLabel(self) self.info_box.setText("") self.right_pane.addWidget(self.info_box) # SKIP button # by some magic this is aligned correctly self.skip_btn = QtGui.QPushButton("skip", self) self.skip_btn.clicked.connect(self.skip) self.right_pane.addWidget(self.skip_btn) self.layout.addLayout(self.right_pane)
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(573, 391) self.verticalLayout = QtGui.QVBoxLayout(Dialog) self.verticalLayout.setObjectName("verticalLayout") self.table = QtGui.QTableWidget(Dialog) self.table.setObjectName("table") self.table.setColumnCount(0) self.table.setRowCount(0) self.verticalLayout.addWidget(self.table) self.label = QtGui.QLabel(Dialog) font = QtGui.QFont() font.setPointSize(12) font.setWeight(75) font.setItalic(False) font.setBold(True) self.label.setFont(font) self.label.setFrameShape(QtGui.QFrame.NoFrame) self.label.setTextFormat(QtCore.Qt.AutoText) self.label.setAlignment(QtCore.Qt.AlignCenter) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label) self.retranslateUi(Dialog) QtCore.QMetaObject.connectSlotsByName(Dialog)
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(400, 300) self.horizontalLayout = QtGui.QHBoxLayout(Form) self.horizontalLayout.setObjectName("horizontalLayout") self.tableLayout = QtGui.QVBoxLayout() self.tableLayout.setObjectName("tableLayout") self.horizontalLayout.addLayout(self.tableLayout) self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.addAttr_btn = QtGui.QPushButton(Form) self.addAttr_btn.setMaximumSize(QtCore.QSize(30, 16777215)) self.addAttr_btn.setObjectName("addAttr_btn") self.verticalLayout.addWidget(self.addAttr_btn) self.removeAttr_btn = QtGui.QPushButton(Form) self.removeAttr_btn.setMaximumSize(QtCore.QSize(30, 16777215)) self.removeAttr_btn.setObjectName("removeAttr_btn") self.verticalLayout.addWidget(self.removeAttr_btn) spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) self.horizontalLayout.addLayout(self.verticalLayout) self.horizontalLayout.setStretch(0, 1) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form)
def __init__(self, *args, **kwargs): super(KeyboardWidget, self).__init__(*args, **kwargs) self.key_map = {} self.active_sequence = QtGui.QKeySequence() layout = QtGui.QVBoxLayout() # Setting up the context checkboxes above. self.init_context_box(layout) # Setting up the main keyboard view. self.init_keyboard_base(layout) # Setting up the bottom area. The search area and the extra keyboard buttons. self.setLayout(layout)
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, parent, compound, E, table): super(PlotDlg, self).__init__(parent) bl = QVBoxLayout(self) self.plotCanvas = MyMplCanvas(self) self.plotCanvas.setSizePolicy( QSizePolicy.Expanding, QSizePolicy.Expanding) self.toolbar = ToolBar(self.plotCanvas, self) bl.addWidget(self.toolbar) bl.addWidget(self.plotCanvas) pg = parent.frameGeometry() self.move(parent.x()+pg.width(), parent.y()) pg = parent.geometry() self.resize(pg.width()*1.5, pg.height()) self.setWindowTitle("plots of f''") self.setWindowFlags(QtCore.Qt.Window) self.show() self.plotCanvas.plot(compound, E, table) # def closeEvent(self, event): # is not invoked by esc. press
def setupUi(self, Form): Form.setObjectName("Form") Form.resize(224, 117) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth()) Form.setSizePolicy(sizePolicy) self.verticalLayout = QtGui.QVBoxLayout(Form) self.verticalLayout.setSpacing(1) self.verticalLayout.setContentsMargins(0, 0, 0, 0) self.verticalLayout.setObjectName("verticalLayout") self.translateLabel = QtGui.QLabel(Form) self.translateLabel.setObjectName("translateLabel") self.verticalLayout.addWidget(self.translateLabel) self.rotateLabel = QtGui.QLabel(Form) self.rotateLabel.setObjectName("rotateLabel") self.verticalLayout.addWidget(self.rotateLabel) self.scaleLabel = QtGui.QLabel(Form) self.scaleLabel.setObjectName("scaleLabel") self.verticalLayout.addWidget(self.scaleLabel) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.mirrorImageBtn = QtGui.QPushButton(Form) self.mirrorImageBtn.setToolTip("") self.mirrorImageBtn.setObjectName("mirrorImageBtn") self.horizontalLayout.addWidget(self.mirrorImageBtn) self.reflectImageBtn = QtGui.QPushButton(Form) self.reflectImageBtn.setObjectName("reflectImageBtn") self.horizontalLayout.addWidget(self.reflectImageBtn) self.verticalLayout.addLayout(self.horizontalLayout) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form)
def __init__(self, parent=None): super(self.__class__, self).__init__(parent=parent) self.setObjectName('TacticDock') self.setLayout(QtGui.QVBoxLayout()) self.window = lib.ui_main_classes.Ui_Main() env.Inst.ui_standalone = self.window self.layout().addWidget(self.window) self.layout().setSpacing(0) self.layout().setContentsMargins(0, 0, 0, 0) self.setSizePolicy(QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding))
def setupUi(self): """Bruh""" self.setGeometry(50, 50, 450, 250) self.setWindowTitle("ZeZe's TWTools - Updating Servers") self.setWindowIcon(QtGui.QIcon(resource_path("images/icon.png"))) """Background color""" self.backgroundPalette = QtGui.QPalette() self.backgroundColor = QtGui.QColor(217, 204, 170) self.backgroundPalette.setColor(QtGui.QPalette.Background, self.backgroundColor) self.setPalette(self.backgroundPalette) """Layout""" self.verticalLayout = QtGui.QVBoxLayout(self) self.text = QtGui.QLabel("Updating server list:") self.verticalLayout.addWidget(self.text) """Download bar""" self.progress_bar = QtGui.QProgressBar(self) self.progress_bar.setMinimum(0) self.progress_bar.setMaximum(27) self.progress_bar.setValue(0) self.progress_bar.setFormat("%v / %m") self.verticalLayout.addWidget(self.progress_bar) """Text browser for progress""" self.progress_text = QtGui.QTextBrowser(self) self.verticalLayout.addWidget(self.progress_text) """Button""" self.horizontalLayout = QtGui.QHBoxLayout(self) self.verticalLayout.addLayout(self.horizontalLayout) self.Spacer = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout.addItem(self.Spacer) self.cancelButton = QtGui.QPushButton("Cancel") self.horizontalLayout.addWidget(self.cancelButton) self.cancelButton.clicked.connect(self.cancel_function)
def runwid(text): w=QtGui.QWidget() w.setStyleSheet("QLabel { color: rgb(255, 0, 0); font-size: 20px; background-color: rgba(255, 255, 100, 100); border: 1px solid rgba(188, 188, 188, 250); }") w.setGeometry(800, 400, 10, 10) box = QtGui.QVBoxLayout() w.setLayout(box) w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) l=QtGui.QLabel(text) box.addWidget(l) return w
def dialog(fn): w=QtGui.QWidget() box = QtGui.QVBoxLayout() w.setLayout(box) w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) l=QtGui.QLabel("Path to Image" ) box.addWidget(l) w.anz = QtGui.QLineEdit() w.anz.setText(fn) box.addWidget(w.anz) loff=QtGui.QLabel("Offset Border" ) box.addWidget(loff) w.off = QtGui.QLineEdit() w.off.setText("100") box.addWidget(w.off) w.rotpos=QtGui.QCheckBox("Rot +90") box.addWidget(w.rotpos) w.rotneg=QtGui.QCheckBox("Rot -90") box.addWidget(w.rotneg) w.rot180=QtGui.QCheckBox("Rot 180") box.addWidget(w.rot180) w.r=QtGui.QPushButton("run") box.addWidget(w.r) w.r.pressed.connect(lambda :runw(w)) w.show() return w
def __init__(self, dialer,obj,menu,noclose,*args): QtGui.QWidget.__init__(self, *args) obj.widget=self self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) self.vollabel =QtGui.QLabel( "<b>"+obj.Object.Label+"</b>") if dialer: dial = QtGui.QDial() dial.setNotchesVisible(True) self.dial=dial dial.setMaximum(100) dial.valueChanged.connect(obj.dialer); layout = QtGui.QVBoxLayout() layout.addWidget(self.vollabel) for m in menu: bt=QtGui.QPushButton(m[0]) bt.clicked.connect(m[1]) layout.addWidget(bt) if dialer: layout.addWidget(dial) if not noclose: self.pushButton02 = QtGui.QPushButton("close") self.pushButton02.clicked.connect(self.hide) layout.addWidget(self.pushButton02) self.setLayout(layout) try: self.setWindowTitle(obj.Object.target.Label) except: pass
def generateWidget( self, idGDT, ContainerOfData ): self.idGDT = idGDT self.ContainerOfData = ContainerOfData self.group = QtGui.QGroupBox(self.Text) vbox = QtGui.QVBoxLayout() for l in self.List: vbox.addLayout(l.generateWidget(self.idGDT, self.ContainerOfData)) self.group.setLayout(vbox) return self.group
def setupUI(self): mainLayout = QtGui.QVBoxLayout() self.setLayout(mainLayout) self.buttonLayout = QtGui.QHBoxLayout() self.msg = QtGui.QLabel() self.addTaskButton = QtGui.QPushButton('Add Task') self.addTaskButton.setToolTip('Add a new task to the list') self.sortButton = QtGui.QPushButton('Reverse Sorting') self.sortButton.setCheckable(True) self.sortButton.setToolTip('Push to sort so highest priorities are at the top,\notherwise lowest will be at the top.') self.helpButton = QtGui.QPushButton('?') self.helpButton.setMaximumWidth(30) self.helpButton.setFlat(True) self.helpButton.setToolTip(self.__helpText()) self.hideButton = QtGui.QPushButton('Hide Finished Tasks') self.hideButton.setCheckable(True) self.hideButton.setToolTip('Hide finished tasks to keep the list tidy') self.clipboardButton = QtGui.QPushButton('Copy To Clipboard') self.clipboardButton.setToolTip('Push to copy current task info to cliboard for pasting into emails or other text documents.\nHandy to keep those coordinators happy.') self.buttonLayout.addWidget(self.addTaskButton) self.buttonLayout.addWidget(self.sortButton) self.buttonLayout.addWidget(self.hideButton) self.buttonLayout.addWidget(self.clipboardButton) self.buttonLayout.addSpacing(20) self.buttonLayout.addWidget(self.helpButton) self.layout().addWidget(self.msg) self.layout().addLayout(self.buttonLayout) self.taskContainer = QtGui.QWidget() self.scrollArea = QtGui.QScrollArea() self.scrollArea.setWidget(self.taskContainer) self.layout().addWidget(self.scrollArea) self.createTaskWidgets() self.update()
def mouseReleaseEvent(self, e): super(CorrelationTableDisplay, self).mouseReleaseEvent(e) if not(self.Selectionmode): regionIDS = [] for i in self.selectedItems(): regionIDS.append((i.row(), i.column())) regionIDS = np.asarray(regionIDS) CorrelationTable = self def newwindow(BoxWidget): i,j = np.amin(regionIDS, axis=0) k,l = np.amax(regionIDS, axis=0) np.reshape(regionIDS,(k-i+1,l-j+1,2)) self.bbox = QtGui.QVBoxLayout() # Number of region ids selected and transfered to teh new window NewTable = NewWindowCorrelationTableDisplay(k-i+1,l-j+1,i,k,j,l,CorrelationTable,regionIDS) self.bbox.addWidget(NewTable) BoxWidget.setLayout(self.bbox) # FIX me resizing table contents with hardcoded values BoxWidget.resize(18*(l-j)+120,18*(k-i+1)+140) # BoxWidget.resize(18*(l-j)+120,18*(k-i+1)+140) if self.First: self.newWindowWidget.append(QtGui.QWidget()) newwindow(self.newWindowWidget[0]) self.newWindowWidget[0].show() self.First = False else: self.i = self.i + 1 self.newWindowWidget.append(QtGui.QWidget()) newwindow(self.newWindowWidget[self.i]) self.newWindowWidget[self.i].show()
def mouseReleaseEvent(self, e): super(CorrelationTableDisplay, self).mouseReleaseEvent(e) if not(self.Selectionmode): regionIDS = [] for i in self.selectedItems(): regionIDS.append((i.row(), i.column())) regionIDS = np.asarray(regionIDS) CorrelationTable = self def newwindow(BoxWidget): i,j = np.amin(regionIDS, axis=0) k,l = np.amax(regionIDS, axis=0) np.reshape(regionIDS,(k-i+1,l-j+1,2)) self.bbox = QtGui.QVBoxLayout() NewTable = NewWindowCorrelationTableDisplay(k-i+1,l-j+1,i,k,j,l,CorrelationTable,regionIDS) self.bbox.addWidget(NewTable) BoxWidget.setLayout(self.bbox) # FIX me resizing table contents with hardcoded values BoxWidget.resize(18*(l-j)+120,18*(k-i+1)+140) if self.First: self.newWindowWidget.append(QtGui.QWidget()) newwindow(self.newWindowWidget[0]) self.newWindowWidget[0].show() self.First = False else: self.i = self.i + 1 self.newWindowWidget.append(QtGui.QWidget()) newwindow(self.newWindowWidget[self.i]) self.newWindowWidget[self.i].show()
def __init__(self, session, parent): super(SummaryPlotDialog, self).__init__() # Center it on the parent location rect = parent.geometry() x, y = rect.center().x(), rect.center().y() w = 1000 h = 640 self.setGeometry(x-w/2, y-h/2, w, h) vbox = QtGui.QVBoxLayout(self) figure_widget = mpl.MPLWidget(None, tight_layout=True) vbox.addWidget(figure_widget) session.make_summary_plot(figure_widget.figure)
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 createWidgets(self): mainVLayout = QtGui.QVBoxLayout() self.objButton = QtGui.QPushButton(self) self.objButton.setText("Convert to OBJ") self.fbxButton = QtGui.QPushButton(self) self.fbxButton.setText("Convert to FBX") mainVLayout.addWidget(self.objButton) mainVLayout.addWidget(self.fbxButton) self.setLayout(mainVLayout)