def createUI(self): loader = QtUiTools.QUiLoader() uifile = QtCore.QFile(':/ui/ddCameraPanel.ui') assert uifile.open(uifile.ReadOnly) self.widget = loader.load(uifile) self.ui = WidgetDict(self.widget.children()) self.widget.setWindowTitle("Camera Visualizer") self.ui.gridLayout_2.setSpacing(0) self.ui.gridLayout_2.setMargin(0) view = self.createCameraView('CAMERACHEST_LEFT') frame1Layout = QtGui.QVBoxLayout(self.ui.frame1) frame1Layout.setSpacing(0) frame1Layout.setMargin(0) frame1Layout.addWidget(view) view = self.createCameraView('MULTISENSE_CAMERA_LEFT') frame2Layout = QtGui.QVBoxLayout(self.ui.frame2) frame2Layout.setSpacing(0) frame2Layout.setMargin(0) frame2Layout.addWidget(view) view = self.createCameraView('CAMERACHEST_RIGHT') frame3Layout = QtGui.QVBoxLayout(self.ui.frame3) frame3Layout.setSpacing(0) frame3Layout.setMargin(0) frame3Layout.addWidget(view)
def wrapInVTitledItem(name, items): box = QtGui.QGroupBox(name) box.setAlignment(QtCore.Qt.AlignCenter) boxLayout = QtGui.QVBoxLayout(box) for item in items: boxLayout.addWidget(item) return box
def _makeTerrainWizard(self): terrainWizard = QtGui.QWidget() self.cinderBlockButton = QtGui.QToolButton() self.cinderBlock2Button = QtGui.QToolButton() self.cinderBlockButton.setIcon(QtGui.QIcon(':/images/cinderblock.png')) self.cinderBlock2Button.setIcon(QtGui.QIcon(':/images/cinderblock_double.png')) self.cinderBlockButton.setIconSize(QtCore.QSize(60,60)) self.cinderBlock2Button.setIconSize(QtCore.QSize(60,60)) self.cinderBlockButton.connect('clicked()', functools.partial(self.onTerrainCinderblockSelected, self.cinderBlockButton)) self.cinderBlock2Button.connect('clicked()', functools.partial(self.onTerrainCinderblockSelected, self.cinderBlock2Button)) buttons = QtGui.QWidget() l = QtGui.QHBoxLayout(buttons) l.setMargin(0) l.addStretch() l.addWidget(self.cinderBlockButton) l.addWidget(self.cinderBlock2Button) l.addStretch() l = QtGui.QVBoxLayout(terrainWizard) l.addWidget(buttons) l.addWidget(_makeButton('double wide', functools.partial(startInteractiveLineDraw, [0.1905*2, 0.149225]))) l.addStretch() return terrainWizard
def __init__(self): self.panel = QtGui.QWidget() self.panel.setWindowTitle('Segmentation Tools') self.taskSelection = PythonQt.dd.ddTaskSelection() self.taskSelection.connect('taskSelected(int)', self.onTaskSelected) l = QtGui.QVBoxLayout(self.panel) self.backButton = self._makeBackButton() l.addWidget(self.backButton) l.addWidget(self.taskSelection) self.backButton.hide() wizards = { 'driving': self._makeDrivingWizard, 'terrain': self._makeTerrainWizard, 'ladder': self._makeLadderWizard, 'debris': self._makeDebrisWizard, 'door': self._makeDoorWizard, 'drill': self._makeDrillWizard, 'valve': self._makeValveWizard, 'firehose': self._makeFirehoseWizard, } self.wizards = {} for name, func in wizards.iteritems(): widget = func() self.wizards[name] = widget l.addWidget(widget) widget.hide()
def _setupPropertiesPanel(self): l = QtGui.QVBoxLayout(self.ui.propertyFrame) l.setMargin(0) self.propertiesPanel = PythonQt.dd.ddPropertiesPanel() self.propertiesPanel.setBrowserModeToWidget() l.addWidget(self.propertiesPanel) self.panelConnector = propertyset.PropertyPanelConnector(self.params.properties, self.propertiesPanel)
def __init__(self, mode): super(CLCreate, self).__init__() ## Dialog Settings self.setFixedSize(300, 100) self.setWindowTitle('Select Channel') ## Vars self.mode = mode ## Layouts layoutV1 = Gui.QVBoxLayout() layoutH1 = Gui.QHBoxLayout() self.setLayout(layoutV1) ## Widgets self.chanCombo = Gui.QComboBox() self.okBtn = Gui.QPushButton('Ok') self.cancelBtn = Gui.QPushButton('Cancel') ## Populate layoutV1.addWidget(self.chanCombo) layoutV1.addLayout(layoutH1) layoutH1.addWidget(self.cancelBtn) layoutH1.addWidget(self.okBtn) ## Connections self.okBtn.connect("clicked()", self.runCreate) self.cancelBtn.connect("clicked()", self.close) ## Init self.init()
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) # --Layout Stuff---------------------------# mainLayout = QtGui.QVBoxLayout() layout = QtGui.QHBoxLayout() self.label = QtGui.QLabel() self.label.setText("port") layout.addWidget(self.label) self.text = QtGui.QLineEdit("10001") layout.addWidget(self.text) self.ip = QtGui.QLabel() self.ip.setText("host") layout.addWidget(self.ip) self.text_ip = QtGui.QLineEdit("0.0.0.0") layout.addWidget(self.text_ip) mainLayout.addLayout(layout) # --The Button------------------------------# layout = QtGui.QHBoxLayout() button = QtGui.QPushButton("okay") # string or icon self.connect(button, QtCore.SIGNAL("clicked()"), self.close) layout.addWidget(button) mainLayout.addLayout(layout) self.setLayout(mainLayout) self.resize(250, 100) self.setWindowTitle("SyConnGate Settings")
def launchViewer(self): playButtonFps = 1.0/self.options['Sim']['dt'] print "playButtonFPS", playButtonFps self.playTimer = TimerCallback(targetFps=playButtonFps) self.playTimer.callback = self.playTimerCallback panel = QtGui.QWidget() l = QtGui.QHBoxLayout(panel) playButton = QtGui.QPushButton('Play/Pause') playButton.connect('clicked()', self.onPlayButton) l.addWidget(playButton) w = QtGui.QWidget() l = QtGui.QVBoxLayout(w) l.addWidget(self.view) l.addWidget(panel) w.showMaximized() self.carFrame.connectFrameModified(self.updateDrawIntersection) self.updateDrawIntersection(self.carFrame) applogic.resetCamera(viewDirection=[0.2,0,-1]) self.view.showMaximized() self.view.raise_() self.app.start()
def __init__ (self, parent): super(_PathTab, self).__init__ (parent) self.plugin = parent box = QtGui.QVBoxLayout(self) # Create group box.addWidget(DirectPathBox(self, self.plugin))
def __init__(self): self.forces = ['pelvis'] self.widget = QtGui.QWidget() self.layout = QtGui.QVBoxLayout(self.widget) self.rebuild() self.layout.addStretch()
def __init__ (self, parent): super(_StepByStepSolverTab, self).__init__ (parent) self.plugin = parent box = QtGui.QVBoxLayout(self) b = QtGui.QPushButton(self) b.text = "Initialize step by step sequence" box.addWidget(b) b.connect("clicked()", self.prepareSolveStepByStep) w = QtGui.QWidget(self) hl = QtGui.QHBoxLayout(w) self.stepCount = QtGui.QSpinBox(w) self.stepCount.setRange(1, 1000) self.value = 1 hl.addWidget(self.stepCount) b = QtGui.QPushButton(self) b.text = "Execute N step" hl.addWidget(b) b.connect("clicked()", self.executeOneStep) box.addWidget(w) b = QtGui.QPushButton(self) b.text = "Finalize" box.addWidget(b) b.connect("clicked()", self.finishSolveStepByStep)
def __init__(self): super(ProgressDialog, self).__init__() self.setWindowTitle('Exporting Textures ...') self.setEnabled(True) self.resize(350, 120) #set layout self.v_layout = QtGui.QVBoxLayout() self.setLayout(self.v_layout) #create cancel button & connect self.cancel_button = QtGui.QPushButton("Cancel") #todo: fix PySide ... utils not working #mari.utils.connect(self.cancel_button.clicked, lambda: self.cancel()) #create other widgets self.pbar = QtGui.QProgressBar(self) self.progress_text = QtGui.QLabel(self) self.progress_text.setText('Exporting Textures ...') self.pbar.setValue(0) #add widgets self.v_layout.addWidget(self.pbar) self.v_layout.addWidget(self.progress_text) self.v_layout.addWidget(self.cancel_button)
def __init__(self): self.panel = QtGui.QWidget() self.panel.setWindowTitle("Segmentation Tools") self.taskSelection = PythonQt.dd.ddTaskSelection() self.taskSelection.connect("taskSelected(int)", self.onTaskSelected) l = QtGui.QVBoxLayout(self.panel) self.backButton = self._makeBackButton() l.addWidget(self.backButton) l.addWidget(self.taskSelection) self.backButton.hide() wizards = { "driving": self._makeDrivingWizard, "terrain": self._makeTerrainWizard, "ladder": self._makeLadderWizard, "debris": self._makeDebrisWizard, "door": self._makeDoorWizard, "drill": self._makeDrillWizard, "valve": self._makeValveWizard, "firehose": self._makeFirehoseWizard, } self.wizards = {} for name, func in wizards.items(): widget = func() self.wizards[name] = widget l.addWidget(widget) widget.hide()
def __init__(self, parent): super(_PathManagement, self).__init__(parent) self.plugin = parent parent.widgetToRefresh.append(self) box = QtGui.QVBoxLayout(self) button = QtGui.QPushButton("Get paths", self) button.connect("clicked()", self.refresh) box.addWidget(button) box.addWidget(QtGui.QLabel("Choose the paths you want to concatenate.\n" "All the paths will be concatenate in the first choose.")) box.addWidget(QtGui.QLabel("List of path:")) self.paths = QtGui.QListWidget() box.addWidget(self.paths) self.paths.setSelectionMode(QtGui.QAbstractItemView.ExtendedSelection) hBox = QtGui.QHBoxLayout() self.buttonConcatenate = QtGui.QPushButton("Concatenate") hBox.addWidget(self.buttonConcatenate) self.buttonConcatenate.connect("clicked()", self.concatenate) self.buttonErase = QtGui.QPushButton("Erase") hBox.addWidget(self.buttonErase) self.buttonErase.connect("clicked()", self.erase) box.addLayout(hBox)
def initWidget(self): box = QtGui.QVBoxLayout(self) random = QtGui.QPushButton(self) box.addWidget(random) applyConstraints = QtGui.QPushButton(self) box.addWidget(applyConstraints) setFrom = QtGui.QPushButton(self) box.addWidget(setFrom) setTo = QtGui.QPushButton(self) box.addWidget(setTo) self.validatePath = QtGui.QCheckBox(self) box.addWidget(self.validatePath) self.projectPath = QtGui.QCheckBox(self) box.addWidget(self.projectPath) makePath = QtGui.QPushButton(self) box.addWidget(makePath) random.text = "Shoot random config" applyConstraints.text = "Apply constraints" setFrom.text = 'Save config as origin' setTo.text = 'Save config as destination' self.validatePath.text = 'Validate path' self.projectPath.text = "Project path" makePath.text = 'Create path' random.connect('clicked()', self.shootRandom) applyConstraints.connect('clicked()', self.applyConstraints) setFrom.connect('clicked()', self.getFrom) setTo.connect('clicked()', self.getTo) makePath.connect('clicked()', self.makePath)
def __init__(self, parent, plugin): super(_NodeCreator, self).__init__(parent) self.plugin = plugin box = QtGui.QVBoxLayout(self) # Name line edit self.nodeName = QtGui.QLineEdit("nodeName") box.addWidget( self.addWidgetsInHBox([QtGui.QLabel("Node name:"), self.nodeName])) # Create group box.addWidget( self.bindFunctionToButton("Create group", self.createGroup)) # Add to group self.groupNodes = QtGui.QComboBox(self) self.groupNodes.editable = False box.addWidget( self.addWidgetsInHBox([ self.groupNodes, self.bindFunctionToButton("Add to group", self.addToGroup) ])) # Add mesh box.addWidget(self.bindFunctionToButton("Add mesh", self.addMesh)) self.update()
def _initTaskPanel(self): self.lastStatusMessage = '' self.nextStepTask = None self.completedTasks = [] self.taskQueue = atq.AsyncTaskQueue() self.taskQueue.connectQueueStarted(self.onQueueStarted) self.taskQueue.connectQueueStopped(self.onQueueStopped) self.taskQueue.connectTaskStarted(self.onTaskStarted) self.taskQueue.connectTaskEnded(self.onTaskEnded) self.taskQueue.connectTaskPaused(self.onTaskPaused) self.taskQueue.connectTaskFailed(self.onTaskFailed) self.taskQueue.connectTaskException(self.onTaskException) self.timer = TimerCallback(targetFps=2) self.timer.callback = self.updateTaskStatus self.timer.start() self.taskTree = tmw.TaskTree() self.ui.taskFrame.layout().insertWidget(0, self.taskTree.treeWidget) l = QtGui.QVBoxLayout(self.ui.taskPropertiesGroupBox) l.addWidget(self.taskTree.propertiesPanel) PythonQt.dd.ddGroupBoxHider(self.ui.taskPropertiesGroupBox) self.ui.taskStepButton.connect('clicked()', self.onStep) self.ui.taskContinueButton.connect('clicked()', self.onContinue) self.ui.taskPauseButton.connect('clicked()', self.onPause) self.ui.promptAcceptButton.connect('clicked()', self.onAcceptPrompt) self.ui.promptRejectButton.connect('clicked()', self.onRejectPrompt) self.clearPrompt() self.updateTaskButtons()
def __init__(self): self.eventFilter = None self.widget = QtGui.QWidget() l = QtGui.QVBoxLayout(self.widget) self.button = _makeButton('enable keyboard navigation', self.clicked) self.button.setCheckable(True) l.addWidget(self.button) self.callbacks = []
def _makeDoorWizard(self): wizard = QtGui.QWidget() l = QtGui.QVBoxLayout(wizard) l.addWidget(_makeButton('segment door handle - left', functools.partial(startDoorHandleSegmentation, 'door_handle_left'))) l.addWidget(_makeButton('segment door handle - right', functools.partial(startDoorHandleSegmentation, 'door_handle_right'))) l.addWidget(_makeButton('segment door frame', functools.partial(startDoorHandleSegmentation, 'doorframe'))) l.addStretch() return wizard
def __init__(self): super(dlg_copyMetricBinding, self).__init__() # - Init self.srcGlyphBounds = {} # - Combos # -- Mode of operation self.cmb_mode = QtGui.QComboBox() self.cmb_mode.addItems(['Active Layer', 'All Master Layers']) # -- Flag color slector self.cmb_flag = QtGui.QComboBox() colorNames = QtGui.QColor.colorNames() for i in range(len(colorNames)): self.cmb_flag.addItem(colorNames[i]) self.cmb_flag.setItemData(i, QtGui.QColor(colorNames[i]), QtCore.Qt.DecorationRole) self.cmb_flag.setCurrentIndex(colorNames.index('lime')) # - Buttons self.btn_copy = QtGui.QPushButton('&Copy Expressions') self.btn_paste = QtGui.QPushButton('&Paste Expressions') self.btn_export = QtGui.QPushButton('&Export to File') self.btn_import = QtGui.QPushButton('&Import from File') self.btn_importFLC = QtGui.QPushButton('&Import from .FLC') self.btn_copy.clicked.connect(self.copyExpr) self.btn_paste.clicked.connect(self.pasteExpr) self.btn_export.clicked.connect(self.exportExpr) self.btn_import.clicked.connect(self.importExpr) self.btn_importFLC.clicked.connect(self.importExprFLC) self.btn_paste.setEnabled(False) #self.btn_export.setEnabled(False) #self.btn_import.setEnabled(False) # - Build layouts layoutV = QtGui.QVBoxLayout() layoutV.addWidget( QtGui.QLabel('Copy/Paste metric expressions to/from:')) layoutV.addWidget(self.cmb_mode) #layoutV.addWidget(QtGui.QLabel('Mark modified glyphs with:')) #layoutV.addWidget(self.cmb_flag) layoutV.addWidget(self.btn_copy) layoutV.addWidget(self.btn_paste) layoutV.addWidget(self.btn_export) layoutV.addWidget(self.btn_import) layoutV.addWidget(self.btn_importFLC) # - Set Widget self.setLayout(layoutV) self.setWindowTitle('%s %s' % (app_name, app_version)) self.setGeometry(300, 300, 220, 120) self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) # Always on top!! self.show()
def __init__(self, parent): super(CollisionPairs, self).__init__(parent) self.plugin = parent # parent.widgetToRefresh.append(self) self.orderedPairs = list() self.pairToRow = dict() box = QtGui.QVBoxLayout(self) button = QtGui.QPushButton( "Toggle between collision and visual robot bodies", self) button.checkable = True button.connect("clicked(bool)", self.toggleVisual) box.addWidget(button) button = QtGui.QPushButton(QtGui.QIcon.fromTheme("view-refresh"), "Refresh list", self) button.connect("clicked()", self.refresh) box.addWidget(button) # Create table self.table = TableWidget(0, 6) self.table.setHorizontalHeaderLabels([ "Active", "Link 1", "Link 2", "Reason", "Current configuration", "% of collision" ]) if Qt.qVersion().startswith('4'): self.table.horizontalHeader().setResizeMode( QtGui.QHeaderView.Interactive) else: self.table.horizontalHeader().setSectionResizeMode( QtGui.QHeaderView.Interactive) self.table.selectionBehavior = QtGui.QAbstractItemView.SelectRows self.table.connect( "currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)", self.currentItemChanged) box.addWidget(self.table) # "Number of random configuration (log scale)" self.sliderRandomCfg = QtGui.QSlider(Qt.Qt.Horizontal, self) self.sliderRandomCfg.setRange(20, 60) self.sliderRandomCfg.setValue(30) box.addWidget(self.sliderRandomCfg) button = QtGui.QPushButton("Compute percentage of collision", self) button.connect("clicked()", self.computePercentageOfCollision) box.addWidget(button) button = QtGui.QPushButton("Save to file...", self) button.connect("clicked()", self.writeToFile) box.addWidget(button) obj = self.plugin.main.getFromSlot("getHppIIOPurl") if obj is not None: obj.connect("configurationValidationStatus(QStringList)", self.currentBodyInCollisions) else: print("Could not find obj")
def __init__(self): self.widget = QtGui.QGroupBox('Drill Planner') self.deltaSpinBoxes = [QtGui.QSpinBox() for i in xrange(3)] for spin in self.deltaSpinBoxes: spin.setMinimum(-100) spin.setMaximum(100) spin.setSingleStep(1) l = QtGui.QVBoxLayout(self.widget) l.addWidget(_makeButton('refit drill', self.refitDrill)) l.addWidget(_makeButton('button preset posture', self.gotoButtonPreset)) l.addWidget(_makeButton('button pre-pose plan', self.buttonPrePosePlan)) l.addWidget(_makeButton('request nominal plan', self.nominalPlan)) l.addWidget( _makeButton('request arm prepose plan', self.armPreposePlan)) l.addWidget(_makeButton('request walking goal', self.walkingGoal)) l.addWidget( _makeButton('request nominal fixed plan', self.nominalFixedPlan)) l.addWidget(_makeButton('request pre-drill plan', self.preDrillPlan)) l.addWidget(_makeButton('request drill-in plan', self.drillInPlan)) l.addWidget(QtGui.QLabel('')) l.addWidget(_makeButton('next drill plan', self.nextDrillPlan)) hw = QtGui.QWidget() hl = QtGui.QHBoxLayout(hw) hl.addWidget(_makeButton('set drill depth', self.setDrillDepth)) self.drillDepthSpin = QtGui.QSpinBox() self.drillDepthSpin.setMinimum(-100) self.drillDepthSpin.setMaximum(100) self.drillDepthSpin.setSingleStep(1) hl.addWidget(self.drillDepthSpin) hl.addWidget(QtGui.QLabel('cm')) l.addWidget(hw) hw = QtGui.QWidget() hl = QtGui.QHBoxLayout(hw) self.drillDeltaCombo = QtGui.QComboBox() self.drillDeltaCombo.addItem('button') self.drillDeltaCombo.addItem('wall') self.drillDeltaButton = _makeButton('drill delta', self.drillDelta) hl.addWidget(self.drillDeltaButton) hl.addWidget(self.drillDeltaCombo) for spin in self.deltaSpinBoxes: hl.addWidget(spin) hl.addWidget(QtGui.QLabel('cm')) hl.addWidget(_makeButton('clear', self.clearDrillDelta)) l.addWidget(QtGui.QLabel('')) l.addWidget(QtGui.QLabel('')) l.addWidget(hw) self.keyPressNav = KeyboardNavigation() self.keyPressNav.callbacks.append(self.onKeyPress) l.addWidget(self.keyPressNav.widget)
def _makeFirehoseWizard(self): firehoseWizard = QtGui.QWidget() segmentButton = QtGui.QToolButton() segmentButton.setIcon(QtGui.QIcon(':/images/wye.png')) segmentButton.setIconSize(QtCore.QSize(60,60)) segmentButton.connect('clicked()', self.onSegmentWye) l = QtGui.QVBoxLayout(firehoseWizard) l.addWidget(segmentButton) l.addWidget(_makeButton('segment hose nozzle', startHoseNozzleSegmentation)) l.addStretch() return firehoseWizard
def _setupPropertiesPanel(self): l = QtGui.QVBoxLayout(self.ui.paramsContainer) l.setMargin(0) self.propertiesPanel = PythonQt.dd.ddPropertiesPanel() self.propertiesPanel.setBrowserModeToWidget() l.addWidget(self.propertiesPanel) self.panelConnector = propertyset.PropertyPanelConnector( self.driver.params.properties, self.propertiesPanel) self.driver.params.properties.connectPropertyChanged( self.onPropertyChanged) PythonQt.dd.ddGroupBoxHider(self.ui.paramsContainer)
def initGUI(self): self.setWindowTitle("Watershed Splitter Hybrid Mode Widget") widgetLayout = QtGui.QVBoxLayout() self.setLayout(widgetLayout) self.markerRadiusEdit = QtGui.QLineEdit() self.baseSubObjIdEdit = QtGui.QLineEdit() self.workAreaSizeEdit = QtGui.QLineEdit() opButtonsLayout = QtGui.QHBoxLayout() widgetLayout.addLayout(opButtonsLayout) self.resetButton = QtGui.QPushButton("Reset") self.resetButton.enabled = False self.resetButton.clicked.connect(self.resetButtonClicked) opButtonsLayout.addWidget(self.resetButton) self.finishButton = QtGui.QPushButton("Finish") self.finishButton.enabled = False self.finishButton.clicked.connect(self.finishButtonClicked) opButtonsLayout.addWidget(self.finishButton) self.subObjTableGroupBox = QtGui.QGroupBox("SubObjects") subObjTableLayout = QtGui.QVBoxLayout() widgetLayout.addLayout(subObjTableLayout) self.subObjTableGroupBox.setLayout(subObjTableLayout) self.subObjTable = self.MyTableWidget(self.subObjTableDel) subObjTableWidget = QtGui.QWidget() subObjTableLayout.addWidget(subObjTableWidget) subObjTableLayout = QtGui.QVBoxLayout() subObjTableWidget.setLayout(subObjTableLayout) subObjTableLayout.addWidget(self.subObjTable) self.setTableHeaders(self.subObjTable, self.OBJECT_LIST_COLUMNS) self.finalizeTable(self.subObjTable) # Invisibles self.widgetWidthEdit = QtGui.QLineEdit() self.widgetHeightEdit = QtGui.QLineEdit() self.widgetLeftEdit = QtGui.QLineEdit() self.widgetTopEdit = QtGui.QLineEdit() self.curFont = QtGui.QFont() # Window settings self.setWindowFlags(Qt.Qt.Window) # Yes, this has to be a called separately, or else the next call works wrong self.setWindowFlags((self.windowFlags() | Qt.Qt.CustomizeWindowHint) & ~Qt.Qt.WindowCloseButtonHint) self.resize(0,0) return
def __init__(self, mainWindow, flags=None): if flags is None: super(Plugin, self).__init__("Path graph plugin", mainWindow) else: super(Plugin, self).__init__("Path graph plugin", mainWindow, flags) self.setObjectName("Path graph plugin") self.main = mainWindow self.hppPlugin = self.main.getFromSlot("getHppIIOPurl") self.pathPlayer = self.main.getFromSlot("getCurrentPath") self.jointgroupcreator = self.main.getFromSlot( "requestCreateJointGroup") self.comgroupcreator = self.main.getFromSlot("requestCreateComGroup") self.velocities = Velocities(self) self.jointActions = dict() self.jointNames = None self.qcpWidgets = list() # This avoids having a widget bigger than what it needs. It avoids having # a big dock widget and a small osg widget when creating the main osg widget. p = Qt.QSizePolicy.Ignored self.topWidget = QtGui.QSplitter(Qt.Qt.Horizontal, self) self.topWidget.setSizePolicy(Qt.QSizePolicy(p, p)) self.setWidget(self.topWidget) self.leftPane = QtGui.QWidget(self) l = QtGui.QVBoxLayout() self.makeLeftPane(l) self.leftPane.setLayout(l) self.topWidget.addWidget(self.leftPane) self.rightPane = QtGui.QWidget(self) self.rightPaneLayout = QtGui.QVBoxLayout() self.rightPane.setLayout(self.rightPaneLayout) self.addPlotBelow() self.topWidget.addWidget(self.rightPane) self.topWidget.setStretchFactor(1, 1)
def _makeValveWizard(self): wizard = QtGui.QWidget() l = QtGui.QVBoxLayout(wizard) hw = QtGui.QWidget() hl = QtGui.QHBoxLayout(hw) hl.setMargin(0) self.valveMethodCombo = QtGui.QComboBox() self.valveMethodCombo.addItem('auto wall') self.valveMethodCombo.addItem('manual') hl.addWidget(QtGui.QLabel('method:')) hl.addWidget(self.valveMethodCombo) l.addWidget(hw) l.addWidget(_makeButton('segment large valve', self.segmentLargeValve)) l.addWidget(_makeButton('segment small valve', self.segmentSmallValve)) l.addWidget(_makeButton('segment bar', self.segmentLeverValve)) hw = QtGui.QFrame() hl = QtGui.QHBoxLayout(hw) hl.setMargin(0) hl.addWidget( _makeButton('segment value radius:', self.segmentValveCustomRadius)) self.valveRadiusSpin = QtGui.QSpinBox() self.valveRadiusSpin.setMinimum(0) self.valveRadiusSpin.setMaximum(99) self.valveRadiusSpin.setSingleStep(1) hl.addWidget(self.valveRadiusSpin) hl.addWidget(QtGui.QLabel('cm')) l.addWidget(hw) l.addWidget(QtGui.QLabel('')) l.addWidget(_makeButton('refit wall', startRefitWall)) hw = QtGui.QFrame() hl = QtGui.QHBoxLayout(hw) hl.setMargin(0) hl.addWidget( _makeButton('request valve circle plan', self.requestValveCirclePlan)) self.circlePlanAngle = QtGui.QSpinBox() self.circlePlanAngle.setMinimum(-360) self.circlePlanAngle.setMaximum(360) self.circlePlanAngle.setSingleStep(5) hl.addWidget(self.circlePlanAngle) hl.addWidget(QtGui.QLabel('degrees')) l.addWidget(hw) l.addStretch() return wizard
def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.aborted = False # --Layout Stuff---------------------------# mainLayout = QtGui.QVBoxLayout() layout = QtGui.QHBoxLayout() self.label = QtGui.QLabel() self.label.setText("port") layout.addWidget(self.label) self.text = QtGui.QLineEdit("10001") layout.addWidget(self.text) self.ip = QtGui.QLabel() self.ip.setText("host") layout.addWidget(self.ip) self.text_ip = QtGui.QLineEdit("localhost") layout.addWidget(self.text_ip) mainLayout.addLayout(layout) layout = QtGui.QHBoxLayout() self.synapse_tresh = QtGui.QLabel() self.synapse_tresh.setText("Syn. prob. thresh.") layout.addWidget(self.synapse_tresh) self.text_synthresh = QtGui.QLineEdit("0.6") layout.addWidget(self.text_synthresh) self.axodend_button = QtGui.QPushButton("Axo-dendr. syn. only") self.axodend_button.setCheckable(True) self.axodend_button.toggle() layout.addWidget(self.axodend_button) mainLayout.addLayout(layout) # --The Button------------------------------# layout = QtGui.QHBoxLayout() button = QtGui.QPushButton("connect") # string or icon self.connect(button, QtCore.SIGNAL("clicked()"), self.close) layout.addWidget(button) button = QtGui.QPushButton("abort") # string or icon self.connect(button, QtCore.SIGNAL("clicked()"), self.abort_button_clicked) layout.addWidget(button) mainLayout.addLayout(layout) self.setLayout(mainLayout) self.resize(450, 300) self.setWindowTitle("SyConnGate Settings")
def helpButtonClicked(self): instructionsWidget = QtGui.QDialog(self) instructionsWidget.setModal(True) instructionsWidget.setWindowTitle("Plugin Manager Help") instructionsLayout = QtGui.QVBoxLayout() instructionsWidget.setLayout(instructionsLayout) instructionsTextEdit = QtGui.QTextEdit() instructionsTextEdit.setAlignment(Qt.Qt.AlignJustify) instructionsTextEdit.setReadOnly(True) instructionsLayout.addWidget(instructionsTextEdit) instructionsWidget.resize(750, 500) instructionsTextEdit.setPlainText(""" Welcome to Plugin Manager! Introduction: - Plugin manager is the client front-end for a enumeration of local plugins and retrieval of remote plugins - Remote plugins on a server, in a location specified by a URL - All plugin URLs of an organization are listed in a repository index file on a server, in a location indicated by a repo URL - Repository URLs of different organization are listed in a repository list on a knossos server, in a location indicated by the repo list URL - In addition to remote plugins, local plugins can be developed independently of any repository Operation: - The plugin GUI includes a plugin table, metadata table, log table and options - Upon startup of knossos, a default plugin directory is used. This can be reconfigured by "Plugin Dir" - The default knossos repo list URL is used. Chnage it by editing "Repo List URL" - Press "Refresh" to enumerate local plugins and retrieve remote repository indices - Check "Offline" to avoid remote listing: local plugins would be enumerated, no remote plugins would be listed, hence no updates would be available - Press "Update All" to to retrieve all updated remote plugins, or "Update Selected" for those plugins selected in the table - Python files (.py extension) are defined as Knossos plugins by metadata lines of format #KNOSSOS_PLUGIN\\t<Key>\\t<Value> - Mandatory metadata fields are Version and Description. Absence of any disqualifies the file as plugin - All metadata fields are shown at the metadata table when a plugin is clicked - Double-click a plugin in the table to open the local version, if available - Press "Defaults" to restore default plugin dir, repo list URL and other options - Repo index and repo list file format is a header line of <First Field Name>\\t<Second Field Name>\\t<Third Field Name> etc., while the rest of the files is lines of <First Field>\\t<Second Field>\\t<Third Field> etc. Mandatory fields for repo index - URL,Version,Description ; for repo list - Name,URL Notes: - The plugin directory requires refreshing every time a local or remote plugin is added or removed, in order for knossos to correctly reflect available local and remote plugins in the plugin menu - Version numbers are compared from major to minor, using . as hierarchy separator: 3 > 2.2 > 2.1.9 > 1.10 > 1.9 Each version component has to be the pythonic string representation of a number. For example, 1.02 is not supported, use 1.2 instead. - Check "Overwrite Same Version" to overwrite local with remote even when version number is identical - Check "Quiet" to skip errors and make default choices for questions - Press "Save Log" to save the current log into a tab-separated text file - Press "Clear Log" to clear the log """) instructionsWidget.show() return
def initWidget(self): box = QtGui.QVBoxLayout(self) setRefButton = QtGui.QPushButton("Set reference frame", self) setRefButton.connect('clicked()', self.setReference) box.addWidget(setRefButton) self.layout().addWidget(QtGui.QLabel("Current reference frame", self)) self.refName = QtGui.QLabel("", self) self.layout().addWidget(self.refName) self.pointLabel = dict() self.normalLabel = dict() for t in ["global", "local", "reference"]: self.pointLabel[t] = self.addInfo("Point", t) self.normalLabel[t] = self.addInfo("Normal", t)