def __init__(self,args,continuous): self.continuous = continuous gobject.GObject.__init__(self) #start by making our app self.app = QApplication(args) #make a window self.window = QMainWindow() #give the window a name self.window.setWindowTitle("BlatherQt") self.window.setMaximumSize(400,200) center = QWidget() self.window.setCentralWidget(center) layout = QVBoxLayout() center.setLayout(layout) #make a listen/stop button self.lsbutton = QPushButton("Listen") layout.addWidget(self.lsbutton) #make a continuous button self.ccheckbox = QCheckBox("Continuous Listen") layout.addWidget(self.ccheckbox) #connect the buttons self.lsbutton.clicked.connect(self.lsbutton_clicked) self.ccheckbox.clicked.connect(self.ccheckbox_clicked) #add a label to the UI to display the last command self.label = QLabel() layout.addWidget(self.label) #add the actions for quiting quit_action = QAction(self.window) quit_action.setShortcut('Ctrl+Q') quit_action.triggered.connect(self.accel_quit) self.window.addAction(quit_action)
def __init__(self, fileInfo, gallery, parent=None, flags=Qt.Widget): QWidget.__init__(self, parent, flags) self.setLayout(QFormLayout(parent=self)) self.request = QGalleryQueryRequest(gallery, self) self.request.setFilter(QDocumentGallery.filePath.equals(fileInfo.absoluteFilePath())) self.resultSet = None self.propertyKeys = [] self.widgets = [] propertyNames = [ QDocumentGallery.fileName, QDocumentGallery.mimeType, QDocumentGallery.path, QDocumentGallery.fileSize, QDocumentGallery.lastModified, QDocumentGallery.lastAccessed, ] labels = [ self.tr('File Name'), self.tr('Type'), self.tr('Path'), self.tr('Size'), self.tr('Modified'), self.tr('Accessed'), ] self.requestProperties(QDocumentGallery.File, propertyNames, labels)
def _setup_ui(self): self._btn_pick_1.setFixedWidth(25) self._btn_pick_1.setToolTip('Pick first sequence.') self._btn_pick_2.setFixedWidth(25) self._btn_pick_2.setToolTip('Pick second sequence.') self._btn_compare.setToolTip('Compare sequences.') self._progress_bar.setFixedHeight(10) lyt_seq1 = QHBoxLayout() lyt_seq1.addWidget(self._ledit1) lyt_seq1.addWidget(self._btn_pick_1) lyt_seq2 = QHBoxLayout() lyt_seq2.addWidget(self._ledit2) lyt_seq2.addWidget(self._btn_pick_2) lyt_main = QVBoxLayout() lyt_main.addLayout(lyt_seq1) lyt_main.addLayout(lyt_seq2) lyt_main.addWidget(self._btn_compare) main_widget = QWidget() main_widget.setLayout(lyt_main) self.setCentralWidget(main_widget)
def __init__(self, origin, target_center, clip): QWidget.__init__(self) self.__origin = origin self.__target_center = target_center self.__clip = clip # Default flag values self.__flag = 0 self.__finished = False self.__release = False # Default animation speed self.__speed = 0.006 # Default release fade out step counts self.__releaseSpeed = 30 # Default color self.__color = MColors.PRIMARY_COLOR # Default maximum radius of the ripple self.__maxRadius = 23 # Default minimum radius of the ripple self.__r = 1 # Default minimum opacity self.__minOpacity = 30 # Default maximum opacity self.__maxOpacity = 255 # Counter used in release animation self.__i = 0
def setup_ui(self): """ Setup the UI for the window. """ central_widget = QWidget() layout = QVBoxLayout() layout.addWidget(self.clock_view) layout.addWidget(self.message_view) central_widget.setLayout(layout) self.setCentralWidget(central_widget) menubar = self.menuBar() file_menu = QMenu('File') preferences_action = QAction('Preferences', file_menu) preferences_action.triggered.connect(self.on_preferences_triggered) quit_action = QAction('Quit', file_menu) quit_action.triggered.connect(self.on_quit_triggered) file_menu.addAction(preferences_action) file_menu.addAction(quit_action) menubar.addMenu(file_menu) view_menu = QMenu('View') fullscreen_action = QAction('Fullscreen', view_menu) fullscreen_action.setCheckable(True) fullscreen_action.setChecked(Config.get('FULLSCREEN', True)) fullscreen_action.setShortcut('Ctrl+Meta+F') fullscreen_action.toggled.connect(self.on_fullscreen_changed) view_menu.addAction(fullscreen_action) menubar.addMenu(view_menu)
def __init__(self,parent=None,measdata=[[1,3,2],[3,5,7]],header=["index","prime numbers"],SymbolSize=10,linecolor='y',pointcolor='b',title='Plot Window'): # This class derivates from a Qt MainWindow so we have to call # the class builder ".__init__()" #QMainWindow.__init__(self) QWidget.__init__(self) # "self" is now a Qt Mainwindow, then we load the user interface # generated with QtDesigner and call it self.ui self.ui = Plot2DDataWidget_Ui.Ui_Plot2DData() # Now we have to feed the GUI building method of this object (self.ui) # with a Qt Mainwindow, but the widgets will actually be built as children # of this object (self.ui) self.ui.setupUi(self) self.setWindowTitle(title) self.x_index=0 self.y_index=0 self.curve=self.ui.plot_area.plot(pen=linecolor) self.curve.setSymbolBrush(pointcolor) self.curve.setSymbol('o') self.curve.setSymbolSize(SymbolSize) self.parent=parent self.measdata=measdata self.header=header self.update_dropdown_boxes(header) self.update_plot_timer = QTimer() self.update_plot_timer.setSingleShot(True) #The timer would not wait for the completion of the task otherwise self.update_plot_timer.timeout.connect(self.autoupdate) if self.ui.auto_upd.isChecked():self.autoupdate()
def __init__(self, parent=None): QWidget.__init__(self, parent) self.setupUi(self) self.current_directory = None self.settings = QSettings(QSettings.IniFormat, QSettings.UserScope, COMPANY, APPNAME) self.restoreGeometry(self.settings.value(self.__class__.__name__)) self.splitter.restoreState(self.settings.value(SPLITTER)) self.current_directory = self.settings.value(CURRENT_DIRECTORY) self.white_albatross = WhiteAlbatrossWidget() self.white_albatross.figuresChanged.connect(self.on_figures_changed) self.workLayout.insertWidget(1, self.white_albatross) self.type.currentIndexChanged.connect(self.white_albatross.setType) self.type.setCurrentIndex(int(self.settings.value(LAST_FIGURE_TYPE, defaultValue=0))) self.addImages.clicked.connect(self.add_images_click) self.openFolder.clicked.connect(self.open_folder_clicked) self.removeImages.clicked.connect(self.remove_images) self.imagesList.itemSelectionChanged.connect(self.item_selected) self.deleteFigure.clicked.connect(self.delete_figure) self.figures.customContextMenuRequested.connect(self.figures_context_menu) if self.current_directory: self.open_folder() self.imagesList.setCurrentRow(int(self.settings.value(SELECTED_IMAGE, defaultValue=0)))
def __init__(self, parent=None): QWidget.__init__(self, parent) self.setupUi(self) self.settings = QSettings(QSettings.IniFormat, QSettings.UserScope, COMPANY, APPNAME) self.restoreGeometry(self.settings.value(self.__class__.__name__)) self.images = [] if len(sys.argv) > 1: d = QDir(path=sys.argv[1]) else: d = QDir(path=QFileDialog.getExistingDirectory()) d.setNameFilters(['*.png']) d.setFilter(QDir.Files or QDir.NoDotAndDotDot) d = QDirIterator(d) images = [] while d.hasNext(): images.append(d.next()) for i in images: print i self.images = [QImage(i) for i in images] self.images += [crop_image_from_file(i, 50)[0] for i in images]
def __init__(self, stepper): QWidget.__init__(self) button_layout = QGridLayout() self.setLayout(button_layout) button_layout.setColumnStretch(0, 0) button_layout.setColumnStretch(1, 0) button_layout.setColumnStretch(3, 0) button_layout.setRowStretch(0, 0) button_layout.setRowStretch(1, 0) button_layout.setRowStretch(3, 0) button_layout.setRowStretch(4, 0) qmy_button(button_layout, stepper.go_to_previous_turn, "pre", the_row=0, the_col=0) qmy_button(button_layout, stepper.go_to_next_turn, "next", the_row=0, the_col=1) qmy_button(button_layout, stepper.insert_before, "ins before", the_row=1, the_col=0) qmy_button(button_layout, stepper.insert_after, "ins after", the_row=1, the_col=1) qmy_button(button_layout, stepper.delete_current_turn, "delete turn", the_row=1, the_col=2) qmy_button(button_layout, stepper.commit, "commit", the_row=2, the_col=0) qmy_button(button_layout, stepper.commit_all, "commit all", the_row=2, the_col=1) qmy_button(button_layout, stepper.revert_current_and_redisplay, "revert", the_row=2, the_col=2) qmy_button(button_layout, stepper.save_file, "save", the_row=3, the_col=0) qmy_button(button_layout, stepper.save_file_as, "save as ...", the_row=3, the_col=1) qmy_button(button_layout, stepper.fill_time_code, "fill time", the_row=4, the_col=0) qmy_button(button_layout, stepper.sync_video, "sync video", the_row=4, the_col=1) button_layout.addWidget(QWidget(), 2, 3) button_layout.addWidget(QWidget(), 5, 0)
def __init__( self, parent ): QScrollArea.__init__(self, parent) self.setFrameShape(QScrollArea.NoFrame) self.setAutoFillBackground(False) self.setWidgetResizable(True) self.setMouseTracking(True) #self.verticalScrollBar().setMaximumWidth(10) widget = QWidget(self) # define custom properties self._rolloutStyle = AccordionWidget.Rounded self._dragDropMode = AccordionWidget.NoDragDrop self._scrolling = False self._scrollInitY = 0 self._scrollInitVal = 0 self._itemClass = AccordionItem layout = QVBoxLayout() layout.setContentsMargins(2, 2, 2, 2) layout.setSpacing(2) layout.addStretch(1) widget.setLayout(layout) self.setWidget(widget)
def __init__(self, parent,silhouette,completeness,homogeneity,v_score,AMI,ARS): QDialog.__init__( self, parent ) layout = QVBoxLayout() viewLayout = QFormLayout() viewLayout.addRow(QLabel('Silhouette score: '),QLabel(silhouette)) viewLayout.addRow(QLabel('Completeness: '),QLabel(completeness)) viewLayout.addRow(QLabel('Homogeneity: '),QLabel(homogeneity)) viewLayout.addRow(QLabel('V score: '),QLabel(v_score)) viewLayout.addRow(QLabel('Adjusted mutual information: '),QLabel(AMI)) viewLayout.addRow(QLabel('Adjusted Rand score: '),QLabel(ARS)) viewWidget = QGroupBox() viewWidget.setLayout(viewLayout) layout.addWidget(viewWidget) #Accept cancel self.acceptButton = QPushButton('Ok') self.cancelButton = QPushButton('Cancel') self.acceptButton.clicked.connect(self.accept) self.cancelButton.clicked.connect(self.reject) hbox = QHBoxLayout() hbox.addWidget(self.acceptButton) hbox.addWidget(self.cancelButton) ac = QWidget() ac.setLayout(hbox) layout.addWidget(ac) self.setLayout(layout)
def __init__(self, parameter, parent=None): _ParameterWidget.__init__(self, parameter, parent) # Variables model = _LayerModel() self._material_class = Material # Actions act_add = QAction(getIcon("list-add"), "Add layer", self) act_remove = QAction(getIcon("list-remove"), "Remove layer", self) act_clean = QAction(getIcon('edit-clear'), "Clear", self) # Widgets self._cb_unit = UnitComboBox('m') self._cb_unit.setUnit('um') self._tbl_layers = QTableView() self._tbl_layers.setModel(model) self._tbl_layers.setItemDelegate(_LayerDelegate()) header = self._tbl_layers.horizontalHeader() header.setResizeMode(QHeaderView.Stretch) header.setStyleSheet('color: blue') self._tlb_layers = QToolBar() spacer = QWidget() spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self._tlb_layers.addWidget(spacer) self._tlb_layers.addAction(act_add) self._tlb_layers.addAction(act_remove) self._tlb_layers.addAction(act_clean) # Layouts layout = QVBoxLayout() layout.setContentsMargins(0, 0, 0, 0) sublayout = QHBoxLayout() sublayout.addStretch() sublayout.addWidget(QLabel('Thickness unit')) sublayout.addWidget(self._cb_unit) layout.addLayout(sublayout) layout.addWidget(self._tbl_layers) layout.addWidget(self._tlb_layers) self.setLayout(layout) # Signals self.valuesChanged.connect(self._onChanged) self.validationRequested.connect(self._onChanged) act_add.triggered.connect(self._onAdd) act_remove.triggered.connect(self._onRemove) act_clean.triggered.connect(self._onClear) self._tbl_layers.doubleClicked.connect(self._onDoubleClicked) model.dataChanged.connect(self.valuesChanged) model.rowsInserted.connect(self.valuesChanged) model.rowsRemoved.connect(self.valuesChanged) self.validationRequested.emit()
def make_central_widget(self, labelText): self.label = QLabel(labelText) mainLayout = QVBoxLayout() mainLayout.addWidget(self.label) w = QWidget() w.setLayout(mainLayout) self.setCentralWidget(w)
def __init__(self, name, arg_dict, pos = "side", max_size = 200): QWidget.__init__(self) self.setContentsMargins(1, 1, 1, 1) if pos == "side": self.layout1=QHBoxLayout() else: self.layout1 = QVBoxLayout() self.layout1.setContentsMargins(1, 1, 1, 1) self.layout1.setSpacing(1) self.setLayout(self.layout1) self.cbox = QCheckBox() # self.efield.setMaximumWidth(max_size) self.cbox.setFont(QFont('SansSerif', 12)) self.label = QLabel(name) # self.label.setAlignment(Qt.AlignLeft) self.label.setFont(QFont('SansSerif', 12)) self.layout1.addWidget(self.label) self.layout1.addWidget(self.cbox) self.arg_dict = arg_dict self.name = name self.mytype = type(self.arg_dict[name]) if self.mytype != bool: self.cbox.setChecked(bool(self.arg_dict[name])) else: self.cbox.setChecked(self.arg_dict[name]) self.cbox.toggled.connect(self.when_modified) self.when_modified()
def __init__(self, *args, **kwargs ): QWidget.__init__( self, *args ) title = "" if kwargs.has_key( 'title' ): title = kwargs['title'] self.infoPath = cmds.about(pd=True) + "/sg/fingerWeightCopy/Widget_LoadVertex_%s.txt" % title sgCmds.makeFile( self.infoPath ) vLayout = QVBoxLayout( self ); vLayout.setContentsMargins(0,0,0,0) groupBox = QGroupBox( title ) groupBox.setAlignment( QtCore.Qt.AlignCenter ) vLayout.addWidget( groupBox ) hLayout = QHBoxLayout() lineEdit = QLineEdit() button = QPushButton("Load"); button.setFixedWidth( 50 ) hLayout.addWidget( lineEdit ) hLayout.addWidget( button ) groupBox.setLayout( hLayout ) self.lineEdit = lineEdit QtCore.QObject.connect( button, QtCore.SIGNAL( "clicked()" ), self.loadVertex ) self.loadInfo()
def __init__(self): QWidget.__init__(self) self.__x = 0 self.__y = 0 self.__elevation = 0 self.__width = 0 self.__height = 0 self.__opacity = 1.0 self.__clip = None self.__parent_clip = None self.__max_width = 0 self.__max_height = 0 self.__min_width = 0 self.__min_height = 0 self.__max_opacity = 1.0 self.__min_opacity = 0.0 self.__margin_left = 0 self.__margin_top = 0 self.__padding_x = 0 self.__padding_y = 0 self.__fading = False # Defining the layout which will hold the child shapes of the widget self.__layout = QGridLayout() self.__layout.setVerticalSpacing(0) self.__layout.setHorizontalSpacing(0) self.__layout.setContentsMargins(QMargins(0, 0, 0, 0)) self.__children = []
def __init__(self, name, arg_dict, pos = "side", max_size = 200): QWidget.__init__(self) self.setContentsMargins(1, 1, 1, 1) if pos == "side": self.layout1=QHBoxLayout() else: self.layout1 = QVBoxLayout() self.layout1.setContentsMargins(1, 1, 1, 1) self.layout1.setSpacing(1) self.setLayout(self.layout1) self.efield = QLineEdit("Default Text") # self.efield.setMaximumWidth(max_size) self.efield.setFont(QFont('SansSerif', 12)) self.label = QLabel(name) # self.label.setAlignment(Qt.AlignLeft) self.label.setFont(QFont('SansSerif', 12)) self.layout1.addWidget(self.label) self.layout1.addWidget(self.efield) self.arg_dict = arg_dict self.name = name self.mytype = type(self.arg_dict[name]) if self.mytype != str: self.efield.setText(str(self.arg_dict[name])) self.efield.setMaximumWidth(50) else: self.efield.setText(self.arg_dict[name]) self.efield.setMaximumWidth(100) self.efield.textChanged.connect(self.when_modified)
def __init__(self, title, *args, **kwargs ): QWidget.__init__( self, *args ) self.infoPath = cmds.about(pd=True) + "/sg/fingerWeightCopy/Widget_loadJoints_%s.txt" % title sgCmds.makeFile( self.infoPath ) layout = QVBoxLayout( self ); layout.setContentsMargins(0,0,0,0) groupBox = QGroupBox( title ) layout.addWidget( groupBox ) baseLayout = QVBoxLayout() groupBox.setLayout( baseLayout ) listWidget = QListWidget() hl_buttons = QHBoxLayout(); hl_buttons.setSpacing( 5 ) b_addSelected = QPushButton( "Add Selected" ) b_clear = QPushButton( "Clear" ) hl_buttons.addWidget( b_addSelected ) hl_buttons.addWidget( b_clear ) baseLayout.addWidget( listWidget ) baseLayout.addLayout( hl_buttons ) self.listWidget = listWidget QtCore.QObject.connect( listWidget, QtCore.SIGNAL( "itemClicked(QListWidgetItem*)" ), self.selectJointFromItem ) QtCore.QObject.connect( b_addSelected, QtCore.SIGNAL("clicked()"), self.addSelected ) QtCore.QObject.connect( b_clear, QtCore.SIGNAL( "clicked()" ), self.clearSelected ) self.otherWidget = None self.loadInfo()
def __init__(self, config, parent=None, **kwargs): QWidget.__init__(self, parent) self.startTime = None self.numDataPoints = 0 self.datasets = {} for display in config['displays']: self.datasets[display['field']] = self.createDatasetForDisplay(display) self.graph = PlotWidget(title=config['title'], labels=config['labels']) # Only add a legend to the graph if there is more than one dataset displayed on it if len(self.datasets) > 1: self.graph.addLegend() # Show grid lines self.graph.showGrid(x=True, y=True) for _, dataset in self.datasets.items(): self.graph.addItem(dataset['plotData']) vbox = QVBoxLayout() vbox.addWidget(self.graph) self.setLayout(vbox)
class ColorWidget(QWidget): """ ColorWidget """ valueChanged = Signal(object) def __init__(self): super(ColorWidget, self).__init__() self.label = QLabel() self.color = [1.0, 1.0, 1.0] buttonLayout = QHBoxLayout() buttonLayout.setContentsMargins(8, 0, 0, 0) self.buttonWidget = QWidget() self.buttonWidget.setLayout(buttonLayout) layout = QGridLayout() layout.setContentsMargins(0, 0, 0, 0) layout.setSpacing(0) layout.addWidget(self.label, 0, 0) layout.addWidget(self.buttonWidget, 0, 1) self.setLayout(layout) def setName(self, name): self.label.setText(name)
def __init__(self, sim): QWidget.__init__(self) self._sim = sim self._screen = None self._rotate = 0 self.setLayout(QGridLayout()) self.invalidate()
def __init__(self): super(STMainWindow, self).__init__() self.createActions() self.createMenus() layout = QVBoxLayout() self.tabs = QTabWidget() self.tabs.setTabPosition(QTabWidget.West) self.tabs.currentChanged[int].connect(self.tabChanged) self.sessiontab = sweattrails.qt.sessiontab.SessionTab(self) self.tabs.addTab(self.sessiontab, "Sessions") self.tabs.addTab(sweattrails.qt.fitnesstab.FitnessTab(self), "Fitness") self.tabs.addTab(sweattrails.qt.profiletab.ProfileTab(self), "Profile") self.usertab = sweattrails.qt.usertab.UserTab(self) self.tabs.addTab(self.usertab, "Users") self.usertab.hide() layout.addWidget(self.tabs) w = QWidget(self) w.setLayout(layout) self.setCentralWidget(w) self.statusmessage = QLabel() self.statusmessage.setMinimumWidth(200) self.statusBar().addPermanentWidget(self.statusmessage) self.progressbar = QProgressBar() self.progressbar.setMinimumWidth(100) self.progressbar.setMinimum(0) self.progressbar.setMaximum(100) self.statusBar().addPermanentWidget(self.progressbar) self.setWindowTitle("SweatTrails") self.setWindowIconText("SweatTrails") icon = QPixmap("image/sweatdrops.png") self.setWindowIcon(QIcon(icon)) QCoreApplication.instance().refresh.connect(self.userSet)
def __init__(self, parent = None): QWidget.__init__(self, parent) self.serviceManager = QServiceManager(self) self.registerExampleServices() self.initWidgets() self.reloadServicesList() self.setWindowTitle(self.tr("Services Browser"))
def setup_gui(self): """Sets up a sample gui interface.""" central_widget = QWidget(self) central_widget.setObjectName('central_widget') self.label = QLabel('Hello World') self.input_field = QLineEdit() change_button = QPushButton('Change text') close_button = QPushButton('close') quit_button = QPushButton('quit') central_layout = QVBoxLayout() button_layout = QHBoxLayout() central_layout.addWidget(self.label) central_layout.addWidget(self.input_field) # a separate layout to display buttons horizontal button_layout.addWidget(change_button) button_layout.addWidget(close_button) button_layout.addWidget(quit_button) central_layout.addLayout(button_layout) central_widget.setLayout(central_layout) self.setCentralWidget(central_widget) # create a system tray icon. Uncomment the second form, to have an # icon assigned, otherwise you will only be seeing an empty space in # system tray self.systemtrayicon = QSystemTrayIcon(self) self.systemtrayicon.show() # set a fancy icon self.systemtrayicon.setIcon(QIcon.fromTheme('help-browser')) change_button.clicked.connect(self.change_text) quit_button.clicked.connect(QApplication.instance().quit) close_button.clicked.connect(self.hide) # show main window, if the system tray icon was clicked self.systemtrayicon.activated.connect(self.icon_activated)
def __init__(self, parent=None): QWidget.__init__(self) self.setMinimumSize(640, 480) self.setMaximumSize(self.minimumSize()) # register this callbacks to interact with the faces and the camera # image before the widget will view the frame self.image_callback = None self.face_callback = None # init view with correct size, depth, channels self.frame = cv.CreateImage((640, 480), cv.IPL_DEPTH_8U, 3) self.storage = cv.CreateMemStorage() self.capture = cv.CaptureFromCAM(0) self.face_cascade = cv.Load(CSC_PATH + "haarcascade_frontalface_alt.xml") self.fd_wait_frames = 1 self._fd_wait = self.fd_wait_frames # get first frame self._query_frame() # set refresh rate self.timer = QTimer(self) self.timer.timeout.connect(self._query_frame) self.timer.start(75)
def paintEvent(self, event): contents_y = self.edit.verticalScrollBar().value() page_bottom = contents_y + self.edit.viewport().height() font_metrics = self.fontMetrics() current_block = self.edit.document().findBlock(self.edit.textCursor().position()) painter = QPainter(self) line_count = 0 block = self.edit.document().begin() while block.isValid(): line_count += 1 position = self.edit.document().documentLayout().blockBoundingRect(block).topLeft() if position.y() > page_bottom: break bold = False if block == current_block: bold = True font = painter.font() font.setBold(True) painter.setFont(font) self.current = line_count painter.drawText( self.width() - font_metrics.width(str(line_count)) - 10, round(position.y()) - contents_y + font_metrics.ascent(), str(line_count), ) if bold: font = painter.font() font.setBold(False) painter.setFont(font) block = block.next() self.highest_line = line_count painter.end() QWidget.paintEvent(self, event)
def __init__(self, *args, **kwargs ): QWidget.__init__( self, *args, **kwargs ) mainLayout = QHBoxLayout( self ) mainLayout.setContentsMargins(0,0,0,0) label = QLabel( "Aim Direction : " ) lineEdit1 = QLineEdit() lineEdit2 = QLineEdit() lineEdit3 = QLineEdit() verticalSeparator = Widget_verticalSeparator() checkBox = QCheckBox( "Set Auto" ) mainLayout.addWidget( label ) mainLayout.addWidget( lineEdit1 ) mainLayout.addWidget( lineEdit2 ) mainLayout.addWidget( lineEdit3 ) mainLayout.addWidget( verticalSeparator ) mainLayout.addWidget( checkBox ) validator = QDoubleValidator( -10000.0, 10000.0, 2 ) lineEdit1.setValidator( validator ) lineEdit2.setValidator( validator ) lineEdit3.setValidator( validator ) lineEdit1.setText( "0.0" ) lineEdit2.setText( "1.0" ) lineEdit3.setText( "0.0" ) checkBox.setChecked( True ) self.label = label; self.lineEdit1 = lineEdit1; self.lineEdit2 = lineEdit2; self.lineEdit3 = lineEdit3; self.checkBox = checkBox self.setVectorEnabled() QtCore.QObject.connect( checkBox, QtCore.SIGNAL( 'clicked()' ), self.setVectorEnabled )
def buildColorStepsControl(self): """Builds the portion of this widget for color cycling options.""" widget = QWidget() layout = QHBoxLayout() self.stepBox = QCheckBox(self.color_step_label) self.stepBox.stateChanged.connect(self.colorstepsChange) self.stepEdit = QLineEdit("8", self) # Setting max to sys.maxint in the validator causes an overflow! D: self.stepEdit.setValidator(QIntValidator(1, 65536, self.stepEdit)) self.stepEdit.setEnabled(False) self.stepEdit.editingFinished.connect(self.colorstepsChange) if self.color_step > 0: self.stepBox.setCheckState(Qt.Checked) self.stepEdit.setEnabled(True) layout.addWidget(self.stepBox) layout.addItem(QSpacerItem(5,5)) layout.addWidget(QLabel("with")) layout.addItem(QSpacerItem(5,5)) layout.addWidget(self.stepEdit) layout.addItem(QSpacerItem(5,5)) layout.addWidget(QLabel(self.number_steps_label)) widget.setLayout(layout) return widget
def create_spinbox(self, prefix, suffix, option, default=NoDefault, min_=None, max_=None, step=None, tip=None): if prefix: plabel = QLabel(prefix) else: plabel = None if suffix: slabel = QLabel(suffix) else: slabel = None spinbox = QSpinBox() if min_ is not None: spinbox.setMinimum(min_) if max_ is not None: spinbox.setMaximum(max_) if step is not None: spinbox.setSingleStep(step) if tip is not None: spinbox.setToolTip(tip) self.spinboxes[option] = spinbox layout = QHBoxLayout() for subwidget in (plabel, spinbox, slabel): if subwidget is not None: layout.addWidget(subwidget) layout.addStretch(1) layout.setContentsMargins(0, 0, 0, 0) widget = QWidget(self) widget.setLayout(layout) return widget
def __init__(self): """ Constructor Function """ # QWidget.__init__(self) # self.setWindowTitle("Icon Sample") # self.setGeometry(300, 300, 200, 150) QWidget.__init__(self) self.setWindowTitle("Icon Sample") self.setGeometry(300, 300, 200, 150) QToolTip.setFont(QFont("Decorative", 8, QFont.Bold)) self.setToolTip('Our Main Window') self.icon = 'C:\Users\Hamed\Documents\soheil sites image\imageedit__9411602959.gif'
def __init__(self): """ Constructor Function """ QWidget.__init__(self) self.setWindowTitle('My Digital Clock') timer = QTimer(self) self.connect(timer, SIGNAL("timeout()"), self.updtTime) self.myTimeDisplay = QLCDNumber(self) self.myTimeDisplay.setSegmentStyle(QLCDNumber.Filled) self.myTimeDisplay.setDigitCount(19) self.myTimeDisplay.resize(500, 150) timer.start(1000)
def __init__(self, *args, **kwargs): QWidget.__init__(self, *args, **kwargs) self.installEventFilter(self) self.layout = QHBoxLayout(self) self.layout.setContentsMargins(0, 0, 0, 0) self.lineEdit_srcAttr = QLineEdit() self.lineEdit_dstAttr = QLineEdit() self.layout.addWidget(self.lineEdit_srcAttr) self.layout.addWidget(self.lineEdit_dstAttr)
def __init__(self, parent=None): QWidget.__init__(self, parent) self.value = QLineEdit() self.value.setReadOnly(True) self.bttn = QPushButton("Change") self.bttn.clicked.connect(self.onChange) layout = QHBoxLayout() layout.addWidget(self.value) layout.addWidget(self.bttn) self.setLayout(layout)
def __init__(self, *args, **kwargs): QWidget.__init__(self, *args, **kwargs) self.installEventFilter(self) self.layout = QHBoxLayout(self) self.layout.setContentsMargins(0, 0, 0, 0) self.button_connect = QPushButton("Connect") self.button_addLine = QPushButton("Add Line") self.lineEdit_dstAttr = QLineEdit() self.layout.addWidget(self.button_connect) self.layout.addWidget(self.button_addLine)
def __init__(self, parent=None): super().__init__(parent=parent) self.setupUi(self) #self.ui = Ui_MainWindow() #self.ui.setupUi(self) spacer = QWidget() spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.toolBar.addWidget(spacer) self.toolBar.addAction(self.action_show_info) self.setup_actions() self.action_open_file.triggered.connect(self.on_open_file)
def __init__(self, game: Game): QWidget.__init__(self) self._game = game self._cols, self._rows = game.size() self.setLayout(QGridLayout()) for y in range(self._rows): for x in range(self._cols): b = QPushButton() self.layout().addWidget(b, y, x) b.clicked.connect(lambda x=x, y=y: self.handle_click(x, y)) self.update_all_buttons() self.setWindowTitle(self.tr('Fifteen Puzzle')) self.show()
def __init__(self, parent=None): QWidget.__init__(self, parent) self.setLayout(QVBoxLayout(self)) self.text_display = QPlainTextEdit(self) self.text_display.setReadOnly(True) self.layout().addWidget(self.text_display) self.text_input = QLineEdit(self) self.text_input.returnPressed.connect(self.send_text) self.layout().addWidget(self.text_input) QWidget.setTabOrder(self.text_input, self.text_display) self.setEnabled(False) self.message.emit('Not connected') self._connection = None
def testLoadFileUnicodeFilePath(self): filePath = str(os.path.join(os.path.dirname(__file__), 'test.ui')) loader = QUiLoader() parent = QWidget() w = loader.load(filePath, parent) self.assertNotEqual(w, None) self.assertEqual(len(parent.children()), 1) child = w.findChild(QWidget, "child_object") self.assertNotEqual(child, None) self.assertEqual(w.findChild(QWidget, "grandson_object"), child.findChild(QWidget, "grandson_object"))
def __init__(self, parent): QWidget.__init__(self, parent) self.customWidgets = {'WidgetLedBank': WidgetLedBank} load_ui(self, 'widget_seq.ui') self._widgetLedSeq.set_led_count(3, Colour.RED, reverse=True) names = ['T0', 'T1', 'T2', 'T3', 'T4'] self._widgetLedStep.set_led_count(5, Colour.GREEN, names, toolTip=False)
def __init__(self, *args, **kwargs ): QWidget.__init__( self, *args, **kwargs ) mainLayout = QVBoxLayout( self ) mainLayout.setContentsMargins(0,0,0,0) listWidget = QListWidget() loadButton = QPushButton( "Load Constrain Targets" ) mainLayout.addWidget( listWidget ) mainLayout.addWidget( loadButton ) self.listWidget = listWidget self.loadButton = loadButton QtCore.QObject.connect( self.loadButton, QtCore.SIGNAL( 'clicked()' ), self.loadConstrainTargets )
def setup_figure(self): self.ui = QWidget(None) self.ui.setLayout(QVBoxLayout()) self.fig = self.gui.add_figure_mpl("photocurrent_iv", self.ui) self.ui.show() self.ax = self.fig.add_subplot(111) self.plotline, = self.ax.plot([0, 1], [0, 0]) #self.ax.set_ylim(1e-1,1e5) self.ax.set_xlabel("Voltage (V)") self.ax.set_ylabel("Current (Amps)")
def __init__(self, parent): QWidget.__init__(self) self.setupUi(self) self.parent = parent self.action_selector.setEnabled(False) self.action_button.setEnabled(False) for k in self.parent.actions.keys(): self.action_selector.addItem(k) self.action_button.clicked.connect(self.action_clicked) self.connect(self.action_selector, QtCore.SIGNAL("currentIndexChanged(QString)"), self.action_selector_changed)
def __init__(self, robocare_serial): self.__robocare_serial = robocare_serial QWidget.__init__(self) layout = QGridLayout() self.setLayout(layout) self.__line1 = QLineEdit() self.__line1.setPlaceholderText("06 F6 F6 F1 0E") self.__line1.setFont(QFont(u"나눔고딕", 15, weight=QFont.Bold)) layout.addWidget(self.__line1, 0, 0, 1, 3) button = QPushButton(u'보내기', self) button.setFont(QFont(u"나눔고딕", 15, weight=QFont.Bold)) button.clicked.connect(self.clicked_custom_once) layout.addWidget(button, 1, 0, 1, 1) self.__line2 = QLineEdit() self.__line2.setPlaceholderText("06 F6 F6 F1 0E") self.__line2.setFont(QFont(u"나눔고딕", 15, weight=QFont.Bold)) layout.addWidget(self.__line2, 2, 0, 1, 3) button = QPushButton(u'버전 체크', self) button.setFont(QFont(u"나눔고딕", 15, weight=QFont.Bold)) button.clicked.connect(self.clicked_version) layout.addWidget(button, 3, 0, 1, 1) button = QPushButton(u'터치 읽기', self) button.setFont(QFont(u"나눔고딕", 15, weight=QFont.Bold)) button.clicked.connect(self.clicked_read) layout.addWidget(button, 3, 1, 1, 1) button = QPushButton(u'100번 읽기', self) button.setFont(QFont(u"나눔고딕", 15, weight=QFont.Bold)) button.clicked.connect(self.clicked_read_100) layout.addWidget(button, 3, 2, 1, 1) button = QPushButton(u'빨강', self) button.setFont(QFont(u"나눔고딕", 15, weight=QFont.Bold)) button.clicked.connect(self.clicked_red) layout.addWidget(button, 4, 0, 1, 1) button = QPushButton(u'녹색', self) button.setFont(QFont(u"나눔고딕", 15, weight=QFont.Bold)) button.clicked.connect(self.clicked_green) layout.addWidget(button, 4, 1, 1, 1) button = QPushButton(u'파랑', self) button.setFont(QFont(u"나눔고딕", 15, weight=QFont.Bold)) button.clicked.connect(self.clicked_blue) layout.addWidget(button, 4, 2, 1, 1)
def getParameterWidget(self): matrixLayout = QGridLayout() matrixLayout.setAlignment(Qt.AlignTop) matrixLayout.setContentsMargins(0, 0, 0, 0) matrixLayout.setSpacing(5) matrixLayout.addWidget(QLabel("Transformation matrix:"), 0, 0, 1, 4) self.m1Edits = [QLineEdit() for _ in range(4)] self.m2Edits = [QLineEdit() for _ in range(4)] self.m3Edits = [QLineEdit() for _ in range(4)] self.m4Edits = [QLineEdit() for _ in range(4)] self.initLineEdits(self.m1Edits, matrixLayout, 1, 0) self.initLineEdits(self.m2Edits, matrixLayout, 2, 0) self.initLineEdits(self.m3Edits, matrixLayout, 3, 0) self.initLineEdits(self.m4Edits, matrixLayout, 4, 0) expandingWidget = QWidget() expandingWidget.setSizePolicy( QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)) matrixLayout.addWidget(expandingWidget, 5, 0, 1, 4) matrixWidget = QWidget() matrixWidget.setLayout(matrixLayout) self.transformUpdated( self.renderWidget.transformations.completeTransform()) return matrixWidget
def initUI(self): self.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded) self.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded) self.listWidget = QWidget() self.layout = QVBoxLayout() self.layout.setContentsMargins(0, 0, 0, 0) self.listWidget.setLayout(self.layout) self.setWidgetResizable(True) self.setWidget(self.listWidget) self.updateList()
class TooltipPositioningWithArrow(TooltipPositioning): ARROW_MARGIN = 7 ARROW_SIZE = 11 ARROW_ODD_SIZE = 15 def _getTopOrBottomArrow(self, alignment, tooltip, main_window): arrow_alignment = TooltipAlignment.mapToMainWindow(tooltip.hoveredWidget(), main_window).x() - alignment + \ tooltip.hoveredWidget().width() / 2 - self.ARROW_ODD_SIZE / 2 if arrow_alignment > tooltip.widget().width(): arrow_alignment = tooltip.widget().width() - self.ARROW_ODD_SIZE self._arrow = QWidget() self._arrow.setLayout(self._getTopOrBottomArrowLayout(arrow_alignment)) self._label_arrow = QLabel() self._label_arrow.setStyleSheet( self._getArrowStylesheet(tooltip.color())) self._label_arrow.setFixedWidth(self.ARROW_ODD_SIZE) self._label_arrow.setFixedHeight(self.ARROW_SIZE) self._arrow.layout().addWidget(self._label_arrow) return self._arrow def _getTopOrBottomArrowLayout(self, arrow_alignment): self._arrow_layout = QHBoxLayout() self._arrow_layout.setAlignment(Qt.AlignLeft) self._arrow_layout.setContentsMargins(arrow_alignment, 0, 0, 0) return self._arrow_layout def _getLeftOrRightArrow(self, alignment, tooltip, main_window): arrow_alignment = TooltipAlignment.mapToMainWindow(tooltip.hoveredWidget(), main_window).y() \ - alignment + tooltip.hoveredWidget().height() / 2 - self.ARROW_ODD_SIZE / 2 if arrow_alignment > tooltip.widget().height(): arrow_alignment = tooltip.widget().height() - self.ARROW_ODD_SIZE self._arrow = QWidget() self._arrow.setLayout(self._getLeftOrRightArrowLayout(arrow_alignment)) self._label_arrow = QLabel() self._label_arrow.setStyleSheet( self._getArrowStylesheet(tooltip.color())) self._label_arrow.setFixedWidth(self.ARROW_SIZE) self._label_arrow.setFixedHeight(self.ARROW_ODD_SIZE) self._arrow.layout().addWidget(self._label_arrow) return self._arrow def _getLeftOrRightArrowLayout(self, arrow_alignment): self._arrow_layout = QVBoxLayout() self._arrow_layout.setAlignment(Qt.AlignTop) self._arrow_layout.setContentsMargins(0, arrow_alignment, 0, 0) return self._arrow_layout def _getArrowStylesheet(self, color="rgb(255, 255, 255)"): raise NotImplementedError("Subclass responsibility") def showTooltip(self, tooltip, align, main_window): raise NotImplementedError("Subclass responsibility")
def createGeneralInfoPanel(self): self.generalInfoPanel = QWidget() self.generalInfoLayout = QtGui.QGridLayout(self.generalInfoPanel) self.lblUSDMXN = QLabel("USD/MXN") self.lblUSDMXN.font() self.lblUSDMXN.setFont( QtGui.QFont("MS Shell Dlg", 12, QtGui.QFont.Normal)) self.generalInfoLayout.addWidget(self.lblUSDMXN, 1, 1) self.lblUSDMXNValue = QLabel("0") self.lblUSDMXNValue.setFont( QtGui.QFont("MS Shell Dlg", 12, QtGui.QFont.Bold)) self.generalInfoLayout.addWidget(self.lblUSDMXNValue, 1, 2) self.generalInfoPanel.setFixedSize(200, 50) self.layout.addWidget(self.generalInfoPanel, 1, 2)
def init_ui(self): # geometry is x offset, y offset, x width, y width self.setGeometry(150, 150, 640, 300) self.setWindowTitle(self.title) menu_bar = self.menuBar() file_menu = menu_bar.addMenu('&File') exitAction = QAction('E&xit', self) exitAction.setStatusTip('Exit the application.') exitAction.triggered.connect(self.handle_exit) file_menu.addAction(exitAction) main_layout_container = QWidget() main_layout = QBoxLayout(QBoxLayout.TopToBottom) image_layout = QBoxLayout(QBoxLayout.LeftToRight) image_layout.addStretch(1) self.image1 = QLabel() self.image1.setAlignment(Qt.AlignCenter) image_layout.addWidget(self.image1) image_layout.addWidget(QLabel("vs.")) self.image2 = QLabel() self.image2.setAlignment(Qt.AlignCenter) image_layout.addWidget(self.image2) image_layout.addStretch(1) main_layout.addLayout(image_layout) main_layout.addStretch(1) button_layout = QBoxLayout(QBoxLayout.LeftToRight) button_layout.addStretch(1) self.yes_button = QPushButton("Yes") button_layout.addWidget(self.yes_button) self.yes_button.clicked.connect(self.handle_yes_pressed) self.no_button = QPushButton("No") button_layout.addWidget(self.no_button) self.no_button.clicked.connect(self.handle_no_pressed) button_layout.addStretch(1) main_layout.addLayout(button_layout) main_layout_container.setLayout(main_layout) self.image1_filepath = "" self.image2_filepath = "" self.load_more_images() self.setCentralWidget(main_layout_container)
def __init__(self, parent=None): QWidget.__init__(self, parent) self.directory = None self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.type = 0 self.images = [] self.image = None self.figure_adding = FigureAdding() self.moving_image = MovingImage() self.state = self.figure_adding
def generate_dialogs(self): vlayout = QVBoxLayout() commit_button = QPushButton("&Commit") w_all = QWidget() v = QVBoxLayout() for cell in self.plasm.cells(): tendril_widgets = [] for name, tendril in cell.params: if self.whitelist is None or self.is_in_whitelist( cell.name(), name): tw = TendrilWidget(name, tendril) commit_button.clicked.connect(tw.thunker.commit) tendril_widgets.append(tw) if tendril_widgets: w = QWidget() cvlayout = QVBoxLayout() cvlayout.addWidget(QLabel(cell.name())) for tendril_widget in tendril_widgets: cvlayout.addWidget(tendril_widget) w.setLayout(cvlayout) # w.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) v.addWidget(w) w_all.setLayout(v) s = QScrollArea() s.setWidget(w_all) vlayout.addWidget(s) vlayout.addWidget(commit_button) self.setLayout(vlayout)
def getParameterWidget(self): self.hueSlider = QSlider(Qt.Horizontal) self.hueSlider.setMaximum(360) self.hueSlider.setValue(self.fixedHue) self.hueSlider.valueChanged.connect(self.valueChanged) layout = QGridLayout() layout.setAlignment(Qt.AlignTop) layout.addWidget(QLabel("Base hue"), 0, 0) layout.addWidget(self.hueSlider, 0, 1) widget = QWidget() widget.setLayout(layout) return widget
def __init__(self, parent): self.parent = parent QWidget.__init__(self) self.state = "Opening Screen" self.setAutoFillBackground(True) self.layout = QGridLayout(self) self.setLayout(self.layout) self.currentWidget = Header(self) self.setPalette(self.currentWidget.palette()) self.layout.addWidget(self.currentWidget, 0, 0, 2, 2) #self.layout.setSizeConstraint(QLayout.SetFixedSize) self.currentWidget.show() self.show() self.raise_()
def __init__(self, *args, **kwargs ): QMainWindow.__init__( self, *args, **kwargs ) self.installEventFilter( self ) self.setWindowTitle( " PingoTools Installer" ) self.setWindowIcon( QtGui.QIcon( os.path.dirname( __file__ ) + '/images/letter-p.png') ) self.resize( 518, 400 ) self.mainWidget = QWidget() self.setCentralWidget( self.mainWidget ) self.mainLayout = QVBoxLayout() self.mainWidget.setLayout( self.mainLayout ) self.firstPage()
def __init__(self, movementList): QWidget.__init__(self) self.layout = QtGui.QGridLayout(self) self.positionTableWidget = QTableWidget() self.resize(800, 400) self.positionTableWidget.setRowCount(10000) self.positionTableWidget.setColumnCount(len(self.columnList)) self.positionTableWidget.setHorizontalHeaderLabels(self.columnList) self.positionTableWidget.resizeColumnsToContents() self.positionTableWidget.resizeRowsToContents() self.layout.addWidget(self.positionTableWidget, 1, 0) for (movement) in movementList: self.renderMovements(movement) self.positionTableWidget.setRowCount(self.row)
def show(self, flags=None, focus=True): QWidget.show(self) if self.visible: self.find(flags) else: self.editor.ui.centralwidget.layout().addWidget(self) self.visible = True self.find(flags) self.update_highlight() if focus: self.ui.edtFindText.setFocus() self.editor.find_action.setChecked(True)
def __init__(self, *args, **kwargs): QWidget.__init__(self, *args, **kwargs) self.installEventFilter(self) self.layout = QHBoxLayout(self) self.layout.setContentsMargins(0, 0, 0, 0) self.text_key = QLabel('Float') self.text_value = QLabel('Value') self.text_key.setAlignment(QtCore.Qt.AlignCenter) self.text_value.setAlignment(QtCore.Qt.AlignCenter) self.layout.addWidget(self.text_key) self.layout.addWidget(self.text_value)
def __init__(self, *args, **kwargs): QWidget.__init__( self, *args, **kwargs ) self.installEventFilter( self ) self.layout = QHBoxLayout( self ) self.layout.setContentsMargins( 0,0,0,0 ) self.text_srcAttr = QLabel('Attribute Name') self.text_dstAttr = QLabel('Attribute Value') self.text_srcAttr.setAlignment( QtCore.Qt.AlignCenter ) self.text_dstAttr.setAlignment( QtCore.Qt.AlignCenter ) self.layout.addWidget( self.text_srcAttr ) self.layout.addWidget( self.text_dstAttr )
def init(self, parent): """ """ rad = self.factory.radius if not rad: rad = 20 if self.control is None: ctrl = qtLED() layout = QVBoxLayout() layout.addWidget(ctrl) scene = QGraphicsScene() # ctrl.setStyleSheet("qtLED { border-style: none; }"); # ctrl.setAutoFillBackground(True) # system background color scene.setBackgroundBrush(QBrush(QColor(237, 237, 237))) ctrl.setStyleSheet("border: 0px") ctrl.setMaximumWidth(rad + 15) ctrl.setMaximumHeight(rad + 15) x, y = 10, 10 cx = x + rad / 1.75 cy = y + rad / 1.75 brush = self.get_color(self.value.state, cx, cy, rad / 2) pen = QPen() pen.setWidth(0) self.led = scene.addEllipse(x, y, rad, rad, pen=pen, brush=brush) if self.factory.label: txt = QLabel(self.factory.label) layout.addWidget(txt) layout.setAlignment(txt, Qt.AlignHCenter) # txt = scene.addText(self.factory.label, QFont('arial 6')) # txt.setPos(cx, 10) ctrl.setScene(scene) layout.setAlignment(ctrl, Qt.AlignHCenter) self.value.on_trait_change(self.update_object, 'state') self.control = QWidget() self.control.setLayout(layout)
def __init__(self, parent=None): QWidget.__init__(self, parent) layout = QVBoxLayout(self) horiz_layout = QHBoxLayout() self.conditional_legend_widget = EdgeWidget(self, True) self.conditional_legend_widget.setMinimumHeight(15) horiz_layout.addWidget(self.conditional_legend_widget) self.conditional_legend_label = QLabel("Conditional transition", self) horiz_layout.addWidget(self.conditional_legend_label) self.unconditional_legend_widget = EdgeWidget(self, False) self.unconditional_legend_widget.setMinimumHeight(15) horiz_layout.addWidget(self.unconditional_legend_widget) self.unconditional_legend_label = QLabel("Non-conditional transition", self) horiz_layout.addWidget(self.unconditional_legend_label) layout.addLayout(horiz_layout) self.splitter = QSplitter(self) layout.addWidget(self.splitter) self.view = ClassyView(self.splitter) # layout.addWidget(self.view) self.scene = ClassyScene(self) self.view.setScene(self.scene) self._menu_bar = QMenuBar(self) self._menu = QMenu("&File") self._menu_bar.addMenu(self._menu) layout.setMenuBar(self._menu_bar) self.open_action = QAction("O&pen", self) self.exit_action = QAction("E&xit", self) self._menu.addAction(self.open_action) self._menu.addAction(self.exit_action) self.connect(self.open_action, SIGNAL("triggered()"), self.open_file) self.connect(self.exit_action, SIGNAL("triggered()"), self.close) self.settings = QSettings("CD Projekt RED", "TweakDB") self.log_window = QPlainTextEdit(self.splitter) self.splitter.setOrientation(Qt.Vertical) self.setWindowTitle("Classy nodes")
def __init__(self, *args, **kwargs ): QWidget.__init__( self, *args ) self.infoPath = cmds.about(pd=True) + "/sg/fingerWeightCopy/Widget_SelectionGrow.txt" sgCmds.makeFile( self.infoPath ) validator = QIntValidator() layout = QHBoxLayout( self ); layout.setContentsMargins(0,0,0,0) groupBox = QGroupBox() layout.addWidget( groupBox ) hLayout = QHBoxLayout() labelTitle = QLabel( "Grow Selection : " ) buttonGrow = QPushButton( "Grow" ); buttonGrow.setFixedWidth( 50 ) buttonShrink = QPushButton( "Shrink" ); buttonShrink.setFixedWidth( 50 ) lineEdit = QLineEdit(); lineEdit.setValidator( validator );lineEdit.setText( '0' ) hLayout.addWidget( labelTitle ) hLayout.addWidget( buttonGrow ) hLayout.addWidget( buttonShrink ) hLayout.addWidget( lineEdit ) groupBox.setLayout( hLayout ) self.lineEdit = lineEdit QtCore.QObject.connect( buttonGrow, QtCore.SIGNAL("clicked()"), self.growNum ) QtCore.QObject.connect( buttonShrink, QtCore.SIGNAL("clicked()"), self.shrinkNum ) self.vtxLineEditList = [] self.loadInfo()