def showDialog(self): self.d = QtGui.QDialog() buttons = QtGui.QDialogButtonBox() buttons.addButton("Yes", QtGui.QDialogButtonBox.AcceptRole) buttons.addButton("No", QtGui.QDialogButtonBox.RejectRole) buttons.connect("accepted()", self.d.accept) buttons.connect("rejected()", self.d.reject) l = QtGui.QVBoxLayout(self.d) l.addWidget(QtGui.QLabel(self.message)) l.addWidget(buttons) self.d.setAttribute(QtCore.Qt.WA_QuitOnClose, False) self.d.show() self.d.raise_() self.d.connect("accepted()", self.onYes) self.d.connect("rejected()", self.onNo)
def showDialog(self): self.d = QtGui.QDialog() buttons = QtGui.QDialogButtonBox() buttons.addButton('Yes', QtGui.QDialogButtonBox.AcceptRole) buttons.addButton('No', QtGui.QDialogButtonBox.RejectRole) buttons.connect('accepted()', self.d.accept) buttons.connect('rejected()', self.d.reject) l = QtGui.QVBoxLayout(self.d) l.addWidget(QtGui.QLabel(self.properties.message)) l.addWidget(buttons) self.d.setAttribute(QtCore.Qt.WA_QuitOnClose, False) self.d.show() self.d.raise_() self.d.connect('accepted()', self.accept) self.d.connect('rejected()', self.reject)
def updateLayout(self): self.storeButtons = [] self.flyButtons = [] self.textEdits = [] w = QtGui.QWidget() l = QtGui.QGridLayout(w) for i in range(self.numberOfBookmarks): storeButton = QtGui.QPushButton("Set") flyButton = QtGui.QPushButton("Fly") textEdit = QtGui.QLineEdit("camera %d" % i) storeButton.connect("clicked()", self.storeMapper, "map()") flyButton.connect("clicked()", self.flyMapper, "map()") self.storeMapper.setMapping(storeButton, storeButton) self.flyMapper.setMapping(flyButton, flyButton) self.storeButtons.append(storeButton) self.flyButtons.append(flyButton) self.textEdits.append(textEdit) l.addWidget(storeButton, i, 0) l.addWidget(flyButton, i, 1) l.addWidget(textEdit, i, 2) flyButton.setEnabled(False) self.flySpeedSpinner = QtGui.QDoubleSpinBox() self.flySpeedSpinner.setMinimum(0) self.flySpeedSpinner.setMaximum(60) self.flySpeedSpinner.setDecimals(1) self.flySpeedSpinner.setSingleStep(0.5) self.flySpeedSpinner.setSuffix(" seconds") self.flySpeedSpinner.setValue(1.0) l.addWidget(QtGui.QLabel("Fly speed:"), i + 1, 0, 2) l.addWidget(self.flySpeedSpinner, i + 1, 2) loadButton = QtGui.QPushButton("Load Stored") loadButton.connect("clicked()", self.loadStoredValues) l.addWidget(loadButton, i + 2, 0, 2) printButton = QtGui.QPushButton("Print Camera") printButton.connect("clicked()", self.printCurrentCamera) l.addWidget(printButton, i + 2, 2) self.widget.setWidget(w)
def UI(self): self.setWindowTitle("HDR Choice") main_layout = gui.QHBoxLayout(self) #Left Layout self.left_group = gui.QGroupBox(self) self.left_group_layout = gui.QGridLayout(self) self.left_group.setLayout(self.left_group_layout) #HDR Combobox self.hdr_combobox = gui.QComboBox() os.chdir(self.hdr_path) for file in glob.glob("*.HDR"): #Get HDR in folder split_file = file.split(".")[0] self.hdr_list.append(split_file) num = 0 for maps in self.hdr_list: #Add Maps in combobox self.hdr_combobox.insertItem(num, maps) num = num + 1 self.left_group_layout.addWidget(self.hdr_combobox) # #Thumbnail viewer self.thumb_view = gui.QLabel() self.selection = self.hdr_combobox.currentText self.pixmap = gui.QPixmap(self.thumb_path + "\\" + self.selection + "_thumb.jpg") self.thumb_view.setPixmap(self.pixmap) self.left_group_layout.addWidget(self.thumb_view) self.hdr_combobox.connect("currentIndexChanged(int)", self.change_hdr_pixmap) #Apply HDR apply_hdr = gui.QPushButton("Apply HDR") self.left_group_layout.addWidget(apply_hdr) apply_hdr.connect("clicked()", self.applyHDR) # Add Layout to main main_layout.addWidget(self.left_group)
def __init__(self, robotNames=[]): """ Initialise the selector object :param robotNames: The names of robots to add to the combobox to start with """ super(RobotSelector, self).__init__() self.objectName = "RobotSelector" self.robotNames = robotNames self.associatedWidgets = ( {}) # associated objects are stored here. Keys are robot names self.robotSelectLabel = QtGui.QLabel("Controlling:") self.robotSelectCombo = QtGui.QComboBox() for robotName in self.robotNames: self.addRobot(robotName) self.horizLayout = QtGui.QHBoxLayout(self) self.horizLayout.addWidget(self.robotSelectLabel) self.horizLayout.addWidget(self.robotSelectCombo) self.robotSelectCombo.connect("currentIndexChanged(QString)", self.showAssociatedComponents)
def showRightClickMenu(displayPoint, view): pickedObj, pickedPoint = vis.findPickedObject(displayPoint, view) if not pickedObj: return objectName = pickedObj.getProperty('Name') if objectName == 'grid': return displayPoint = displayPoint[0], view.height - displayPoint[1] globalPos = view.mapToGlobal(QtCore.QPoint(*displayPoint)) menu = QtGui.QMenu(view) widgetAction = QtGui.QWidgetAction(menu) label = QtGui.QLabel('<b>%s</b>' % objectName) label.setContentsMargins(9,9,6,6) widgetAction.setDefaultWidget(label) menu.addAction(widgetAction) menu.addSeparator() propertiesPanel = PythonQt.dd.ddPropertiesPanel() propertiesPanel.setBrowserModeToWidget() propertyset.PropertyPanelHelper.addPropertiesToPanel(pickedObj.properties, propertiesPanel) def onPropertyChanged(prop): om.PropertyPanelHelper.setPropertyFromPanel(prop, propertiesPanel, pickedObj.properties) propertiesPanel.connect('propertyValueChanged(QtVariantProperty*)', onPropertyChanged) propertiesMenu = menu.addMenu('Properties') propertiesWidgetAction = QtGui.QWidgetAction(propertiesMenu) propertiesWidgetAction.setDefaultWidget(propertiesPanel) propertiesMenu.addAction(propertiesWidgetAction) def onDelete(): om.removeFromObjectModel(pickedObj) def onHide(): pickedObj.setProperty('Visible', False) def onSelect(): om.setActiveObject(pickedObj) reachFrame = getAsFrame(pickedObj) collisionParent = getCollisionParent(pickedObj) def onReachLeft(): reachToFrame(reachFrame, 'left', collisionParent) def onReachRight(): reachToFrame(reachFrame, 'right', collisionParent) def flipHandSide(): for obj in [pickedObj] + pickedObj.children(): if not isGraspSeed(obj): continue side = 'right' if obj.side == 'left' else 'left' obj.side = side color = [1.0, 1.0, 0.0] if side == 'right': color = [0.33, 1.0, 0.0] obj.setProperty('Color', color) def flipHandThumb(): handFrame = pickedObj.children()[0] t = transformUtils.copyFrame(handFrame.transform) t.PreMultiply() t.RotateY(180) handFrame.copyFrame(t) pickedObj._renderAllViews() def onSplineLeft(): splinewidget.planner.newSpline(pickedObj, 'left') def onSplineRight(): splinewidget.planner.newSpline(pickedObj, 'right') def getPointCloud(obj): try: obj = obj.model.polyDataObj except AttributeError: pass try: obj.polyData except AttributeError: return None if obj and obj.polyData.GetNumberOfPoints():# and (obj.polyData.GetNumberOfCells() == obj.polyData.GetNumberOfVerts()): return obj pointCloudObj = getPointCloud(pickedObj) affordanceObj = pickedObj if isinstance(pickedObj, affordanceitems.AffordanceItem) else None def onSegmentGround(): groundPoints, scenePoints = segmentation.removeGround(pointCloudObj.polyData) vis.showPolyData(groundPoints, 'ground points', color=[0,1,0], parent='segmentation') vis.showPolyData(scenePoints, 'scene points', color=[1,0,1], parent='segmentation') pickedObj.setProperty('Visible', False) def onCopyPointCloud(): global lastRandomColor polyData = vtk.vtkPolyData() polyData.DeepCopy(pointCloudObj.polyData) if pointCloudObj.getChildFrame(): polyData = segmentation.transformPolyData(polyData, pointCloudObj.getChildFrame().transform) polyData = segmentation.addCoordArraysToPolyData(polyData) # generate random color, and average with a common color to make them generally similar lastRandomColor = lastRandomColor + 0.1 + 0.1*random.random() rgb = colorsys.hls_to_rgb(lastRandomColor, 0.7, 1.0) obj = vis.showPolyData(polyData, pointCloudObj.getProperty('Name') + ' copy', color=rgb, parent='point clouds') t = vtk.vtkTransform() t.PostMultiply() t.Translate(filterUtils.computeCentroid(polyData)) segmentation.makeMovable(obj, t) om.setActiveObject(obj) pickedObj.setProperty('Visible', False) def onMergeIntoPointCloud(): allPointClouds = om.findObjectByName('point clouds') if allPointClouds: allPointClouds = [i.getProperty('Name') for i in allPointClouds.children()] sel = QtGui.QInputDialog.getItem(None, "Point Cloud Merging", "Pick point cloud to merge into:", allPointClouds, current=0, editable=False) sel = om.findObjectByName(sel) # Make a copy of each in same frame polyDataInto = vtk.vtkPolyData() polyDataInto.ShallowCopy(sel.polyData) if sel.getChildFrame(): polyDataInto = segmentation.transformPolyData(polyDataInto, sel.getChildFrame().transform) polyDataFrom = vtk.vtkPolyData() polyDataFrom.DeepCopy(pointCloudObj.polyData) if pointCloudObj.getChildFrame(): polyDataFrom = segmentation.transformPolyData(polyDataFrom, pointCloudObj.getChildFrame().transform) # Actual merge append = filterUtils.appendPolyData([polyDataFrom, polyDataInto]) if sel.getChildFrame(): polyDataInto = segmentation.transformPolyData(polyDataInto, sel.getChildFrame().transform.GetInverse()) # resample append = segmentationroutines.applyVoxelGrid(append, 0.01) append = segmentation.addCoordArraysToPolyData(append) # Recenter the frame sel.setPolyData(append) t = vtk.vtkTransform() t.PostMultiply() t.Translate(filterUtils.computeCentroid(append)) segmentation.makeMovable(sel, t) # Hide the old one if pointCloudObj.getProperty('Name') in allPointClouds: pointCloudObj.setProperty('Visible', False) def onSegmentTableScene(): data = segmentation.segmentTableScene(pointCloudObj.polyData, pickedPoint) vis.showClusterObjects(data.clusters + [data.table], parent='segmentation') def onSegmentDrillAlignedWithTable(): segmentation.segmentDrillAlignedWithTable(pickedPoint, pointCloudObj.polyData) def onCachePickedPoint(): ''' Cache the Picked Point for general purpose use''' global lastCachedPickedPoint lastCachedPickedPoint = pickedPoint #data = segmentation.segmentTableScene(pointCloudObj.polyData, pickedPoint) #vis.showClusterObjects(data.clusters + [data.table], parent='segmentation') def onLocalPlaneFit(): planePoints, normal = segmentation.applyLocalPlaneFit(pointCloudObj.polyData, pickedPoint, searchRadius=0.1, searchRadiusEnd=0.2) obj = vis.showPolyData(planePoints, 'local plane fit', color=[0,1,0]) obj.setProperty('Point Size', 7) fields = segmentation.makePolyDataFields(obj.polyData) pose = transformUtils.poseFromTransform(fields.frame) desc = dict(classname='BoxAffordanceItem', Name='local plane', Dimensions=list(fields.dims), pose=pose) box = segmentation.affordanceManager.newAffordanceFromDescription(desc) def onOrientToMajorPlane(): polyData, planeFrame = segmentation.orientToMajorPlane(pointCloudObj.polyData, pickedPoint=pickedPoint) pointCloudObj.setPolyData(polyData) def onDiskGlyph(): result = segmentation.applyDiskGlyphs(pointCloudObj.polyData) obj = vis.showPolyData(result, 'disks', color=[0.8,0.8,0.8]) om.setActiveObject(obj) pickedObj.setProperty('Visible', False) def onArrowGlyph(): result = segmentation.applyArrowGlyphs(pointCloudObj.polyData) obj = vis.showPolyData(result, 'disks') def onSegmentationEditor(): segmentationpanel.activateSegmentationMode(pointCloudObj.polyData) def addNewFrame(): t = transformUtils.copyFrame(affordanceObj.getChildFrame().transform) t.PostMultiply() t.Translate(np.array(pickedPoint) - np.array(t.GetPosition())) newFrame = vis.showFrame(t, '%s frame %d' % (affordanceObj.getProperty('Name'), len(affordanceObj.children())), scale=0.2, parent=affordanceObj) affordanceObj.getChildFrame().getFrameSync().addFrame(newFrame, ignoreIncoming=True) def copyAffordance(): desc = dict(affordanceObj.getDescription()) del desc['uuid'] desc['Name'] = desc['Name'] + ' copy' aff = robotSystem.affordanceManager.newAffordanceFromDescription(desc) aff.getChildFrame().setProperty('Edit', True) def onPromoteToAffordance(): affObj = affordanceitems.MeshAffordanceItem.promotePolyDataItem(pickedObj) robotSystem.affordanceManager.registerAffordance(affObj) actions = [ (None, None), ('Hide', onHide), ('Delete', onDelete), ('Select', onSelect) ] if affordanceObj: actions.extend([ ('Copy affordance', copyAffordance), ('Add new frame', addNewFrame), ]) elif type(pickedObj) == vis.PolyDataItem: actions.extend([ ('Promote to Affordance', onPromoteToAffordance), ]) if isGraspSeed(pickedObj): actions.extend([ (None, None), ('Flip Side', flipHandSide), ('Flip Thumb', flipHandThumb), ]) if reachFrame is not None: actions.extend([ (None, None), ('Reach Left', onReachLeft), ('Reach Right', onReachRight), #('Spline Left', onSplineLeft), #('Spline Right', onSplineRight), ]) if pointCloudObj: actions.extend([ (None, None), ('Copy Pointcloud', onCopyPointCloud), ('Merge Pointcloud Into', onMergeIntoPointCloud), ('Segment Ground', onSegmentGround), ('Segment Table', onSegmentTableScene), ('Segment Drill Aligned', onSegmentDrillAlignedWithTable), ('Local Plane Fit', onLocalPlaneFit), ('Orient with Horizontal', onOrientToMajorPlane), ('Arrow Glyph', onArrowGlyph), ('Disk Glyph', onDiskGlyph), ('Cache Pick Point', onCachePickedPoint), (None, None), ('Open Segmentation Editor', onSegmentationEditor) ]) for actionName, func in actions: if not actionName: menu.addSeparator() else: action = menu.addAction(actionName) action.connect('triggered()', func) selectedAction = menu.popup(globalPos)
def __init__(self): super(ExportQtGui, self).__init__() #--# Create Groups self.mainGroup = QtGui.QGroupBox('Export List') self.optionGroup = QtGui.QGroupBox('Options') #--# Create Layouts layoutV1_main = QtGui.QVBoxLayout() layoutV2_grp = QtGui.QVBoxLayout() layoutV3_grp = QtGui.QVBoxLayout() layoutH1_wdg = QtGui.QHBoxLayout() layoutH2_wdg = QtGui.QHBoxLayout() layoutH3_wdg = QtGui.QHBoxLayout() layoutH4_wdg = QtGui.QHBoxLayout() layoutH5_wdg = QtGui.QHBoxLayout() ## Build Layouts self.setLayout(layoutV1_main) self.mainGroup.setLayout(layoutV2_grp) self.optionGroup.setLayout(layoutV3_grp) layoutV2_grp.addLayout(layoutH1_wdg) layoutV2_grp.addLayout(layoutH2_wdg) layoutV3_grp.addLayout(layoutH3_wdg) layoutV3_grp.addLayout(layoutH4_wdg) layoutV3_grp.addLayout(layoutH5_wdg) #--# Export List TreeWidget self.exportList = QtGui.QTreeWidget() self.exportList.setSelectionMode( QtGui.QAbstractItemView.ExtendedSelection) self.exportList.setSortingEnabled(True) self.exportList.setAlternatingRowColors(True) #--# Create Widgets self.addBtn = QtGui.QToolButton(self) self.removeBtn = QtGui.QToolButton(self) self.clearBtn = QtGui.QToolButton(self) self.addAllBtn = QtGui.QToolButton(self) self.browseBtn = QtGui.QPushButton('Browse') self.exportBtn = QtGui.QPushButton('Export') self.formatCombo = QtGui.QComboBox() self.exportLabel = QtGui.QLabel('Path: ') self.formatLabel = QtGui.QLabel('Format: ') self.templateLabel = QtGui.QLabel('Template: ') self.templateLn = QtGui.QLineEdit(defaultTemplate) self.exportLn = QtGui.QLineEdit() ## Set Icons self.addBtn.setIcon(QtGui.QIcon('%s/Plus.png' % icon_path)) self.removeBtn.setIcon(QtGui.QIcon('%s/Minus.png' % icon_path)) self.clearBtn.setIcon(QtGui.QIcon('%s/Quit.png' % icon_path)) self.addAllBtn.setIcon(QtGui.QIcon('%s/AddObject.png' % icon_path)) #--# Populate Layouts layoutH1_wdg.addWidget(self.exportList) layoutH2_wdg.addWidget(self.addBtn) layoutH2_wdg.addWidget(self.removeBtn) layoutH2_wdg.addWidget(self.clearBtn) layoutH2_wdg.addWidget(self.addAllBtn) layoutH2_wdg.addStretch() layoutH3_wdg.addWidget(self.exportLabel) layoutH3_wdg.addWidget(self.exportLn) layoutH3_wdg.addWidget(self.browseBtn) layoutH4_wdg.addWidget(self.templateLabel) layoutH4_wdg.addWidget(self.templateLn) layoutH4_wdg.addWidget(self.formatLabel) layoutH4_wdg.addWidget(self.formatCombo) layoutH5_wdg.addWidget(self.exportBtn) ## Final layoutV1_main.addWidget(self.mainGroup) layoutV1_main.addWidget(self.optionGroup) #--# StyleSheets self.setStyleSheet("\ QTreeWidget { alternate-background-color: rgb(100, 100, 100); } \ ") #--# Keyboard shortcuts self.deleteKey = QtGui.QShortcut(QtGui.QKeySequence('Delete'), self) #--# Connections self.addBtn.connect("clicked()", self.addUDIM) self.removeBtn.connect("clicked()", lambda: self.manageTree(remove=True)) self.clearBtn.connect("clicked()", self.clear) self.addAllBtn.connect("clicked()", self.addAllObjects) self.browseBtn.connect("clicked()", self.getExportPath) self.exportBtn.connect("clicked()", self.export) self.deleteKey.connect("activated()", lambda: self.manageTree(remove=True)) self.exportList.connect("itemDoubleClicked (QTreeWidgetItem *,int)", lambda: self.manageTree(pick=True)) #--# Init self.init() self.setHeader()
def __init__(self): super(dlg_exportFontsInFolder, self).__init__() self.export = ExportFontsInFolder() menu = QtGui.QMenu('MyMenu') myact = QtGui.QAction('MyAction', self) menu.addAction(myact) menubar = main.menuBar() menubar.addAction(myact) layoutV = QtGui.QVBoxLayout() # Source folder self.lay_src = QtGui.QHBoxLayout() self.lbl_src = QtGui.QLabel('Source folder:') self.lbl_src.setFixedWidth(120) self.lay_src.addWidget(self.lbl_src) self.edt_srcFolder = QtGui.QLineEdit() self.edt_srcFolder.setText(self.export.srcFolder) self.edt_srcFolder.setToolTip( '<p>Finds fonts to be converted in this <b>Source folder</b>. Defaults to the same folder as the currently active font. Click ... to choose a different folder.</p>' ) self.lay_src.addWidget(self.edt_srcFolder) self.btn_pickSrcFolder = QtGui.QPushButton('...') self.btn_pickSrcFolder.setToolTip( '<p>Click to choose a different <b>Source folder</b></p>') self.btn_pickSrcFolder.clicked.connect(self.pickSrcFolder) self.lay_src.addWidget(self.btn_pickSrcFolder) layoutV.addLayout(self.lay_src) # Filtering self.lay_types = QtGui.QHBoxLayout() self.lbl_types = QtGui.QLabel('File types:') self.lbl_types.setFixedWidth(120) self.lay_types.addWidget(self.lbl_types) self.edt_types = QtGui.QLineEdit() self.edt_types.setText(" ".join(self.export.fontTypes)) self.edt_types.setToolTip( '<p>Finds fonts to be converted that match these space-separated <b>patterns</b> (case-insensitive).</p>' ) self.lay_types.addWidget(self.edt_types) self.chk_subfolders = QtGui.QCheckBox('Subfolders') self.chk_subfolders.setCheckState(QtCore.Qt.Unchecked) self.chk_subfolders.setToolTip( '<p>If <b>on</b>, finds fonts to be converted in the Source folder <b>recursively</b> (including subfolders).</p>' ) self.lay_types.addWidget(self.chk_subfolders) layoutV.addLayout(self.lay_types) # Destination folder self.lay_dest = QtGui.QHBoxLayout() self.lbl_dest = QtGui.QLabel('Destination folder:') self.lbl_dest.setFixedWidth(120) self.lay_dest.addWidget(self.lbl_dest) self.edt_destFolder = QtGui.QLineEdit() self.edt_destFolder.setText(self.export.destFolder) self.edt_destFolder.setToolTip( '<p>Exports fonts into this folder. Recreates the Source folder <b>structure</b>. If a font exports as a single file, uses the original filename as the new filename. If a font exports as multiple files, uses the original filename as a subfolder name. Click ... to choose a different folder.</p>' ) self.lay_dest.addWidget(self.edt_destFolder) self.btn_pickDestFolder = QtGui.QPushButton('...') self.btn_pickDestFolder.setToolTip( '<p>Click to choose a different <b>Destination folder</b></p>') self.btn_pickDestFolder.clicked.connect(self.pickDestFolder) self.lay_dest.addWidget(self.btn_pickDestFolder) layoutV.addLayout(self.lay_dest) # Run layout self.lay_run = QtGui.QHBoxLayout() self.lbl_format = QtGui.QLabel( '<small>Hold your pointer over the UI items for instructions</small>' ) self.lbl_format.setStyleSheet('color:darkGray;') self.lay_run.addWidget(self.lbl_format) self.lay_run.addStretch() self.btn_cancel = QtGui.QPushButton('&Cancel') self.btn_cancel.clicked.connect(self.cancel) self.lay_run.addWidget(self.btn_cancel) self.btn_run = QtGui.QPushButton('&Export Fonts As') self.btn_run.setDefault(True) self.btn_run.setFocus() self.btn_run.clicked.connect(self.run) self.btn_run.setToolTip( '<p>Click this button. In the <i>Export Font</i> dialog, choose <b>Content</b>, choose/customize the <b>Profile</b>, but <b>do not change</b> the <b>Destination</b> settings there. Then click <b>Export</b> to start the conversion.</p>' ) self.lay_run.addWidget(self.btn_run) layoutV.addLayout(self.lay_run) # - Set Widget self.setLayout(layoutV) self.setWindowTitle('%s %s' % (app_name, __version__)) self.setGeometry(300, 300, 640, 200) self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) # Always on top!! self.show()
changeToInvalue(q.getOrc()) def toChnget(): changeToChnget(q.getOrc()) # GUI interface w = pqt.QWidget() # Create main widget w.setGeometry(50, 50, 250, 40) l = pqt.QGridLayout(w) # Layout to organize widgets w.setLayout(l) w.setWindowTitle("Switch invalue->chnget") w.setWindowFlags(w.windowFlags() | pqtc.Qt.WindowStaysOnTopHint) t = pqt.QLabel( "Press the buttons to switch invalue/outvalue for chnget/chnset", w) toChngetButton = pqt.QPushButton("Invalue -> Chnget", w) toInvalueButton = pqt.QPushButton("Chnget -> Invalue", w) l.addWidget(toChngetButton, 0, 0) l.addWidget(toInvalueButton, 0, 1) l.addWidget(t, 1, 0, 1, 2) toInvalueButton.connect("clicked()", toInvalue) toChngetButton.connect("clicked()", toChnget) w.show()
v = imageView.view v.render() showImageOverlay() drillDemo.pointerTracker = createPointerTracker() drillDemo.projectCallback = projectDrillDemoInCamera drillYawPreTransform = vtk.vtkTransform() drillYawPreTransform.PostMultiply() def onDrillYawSliderChanged(value): yawOffset = value - 180.0 drillDemo.drillYawSliderValue = yawOffset drillDemo.updateDrillToHand() app.getMainWindow().macrosToolBar().addWidget(QtGui.QLabel('drill yaw:')) slider = QtGui.QSlider(QtCore.Qt.Horizontal) slider.setMaximum(360) slider.setValue(180) slider.setMaximumWidth(200) slider.connect('valueChanged(int)', onDrillYawSliderChanged) app.getMainWindow().macrosToolBar().addWidget(slider) def sendPointerPrep(): drillDemo.planPointerPressGaze(-0.05) def sendPointerPress(): drillDemo.planPointerPressGaze(0.01)
def __init__(self): super(dlg_widthTool, self).__init__() # - Edit Fields self.edt_width = QtGui.QLineEdit() self.edt_height = QtGui.QLineEdit() self.edt_width.setPlaceholderText('Glyph Name') self.edt_height.setPlaceholderText('Glyph Name') # - Spin Box self.spb_width_percent = QtGui.QSpinBox() self.spb_height_percent = QtGui.QSpinBox() self.spb_width_units = QtGui.QSpinBox() self.spb_height_units = QtGui.QSpinBox() self.spb_width_percent.setMaximum(200) self.spb_height_percent.setMaximum(200) self.spb_width_units.setMaximum(200) self.spb_height_units.setMaximum(200) self.spb_width_units.setMinimum(-200) self.spb_height_units.setMinimum(-200) self.spb_width_percent.setSuffix('%') self.spb_height_percent.setSuffix('%') self.spb_width_units.setSuffix(' u') self.spb_height_units.setSuffix(' u') self.spb_width_percent.setMaximumWidth(50) self.spb_height_percent.setMaximumWidth(50) self.spb_width_units.setMaximumWidth(50) self.spb_height_units.setMaximumWidth(50) self.reset_fileds() # - Buttons self.btn_copyBBox_width = QtGui.QPushButton('&Copy Width') self.btn_copyBBox_height = QtGui.QPushButton('&Copy Height') self.btn_copyBBox_width.clicked.connect(lambda: self.copy_bbox(False)) self.btn_copyBBox_height.clicked.connect(lambda: self.copy_bbox(True)) # - Build self.layoutV = QtGui.QGridLayout() self.layoutV.addWidget(QtGui.QLabel('Width:'), 0, 0, 1, 1) self.layoutV.addWidget(self.edt_width, 0, 1, 1, 3) self.layoutV.addWidget(QtGui.QLabel('@'), 0, 4, 1, 1) self.layoutV.addWidget(self.spb_width_percent, 0, 5, 1, 1) self.layoutV.addWidget(QtGui.QLabel('+'), 0, 6, 1, 1) self.layoutV.addWidget(self.spb_width_units, 0, 7, 1, 1) self.layoutV.addWidget(self.btn_copyBBox_width, 0, 8, 1, 1) self.layoutV.addWidget(QtGui.QLabel('Height:'), 1, 0, 1, 1) self.layoutV.addWidget(self.edt_height, 1, 1, 1, 3) self.layoutV.addWidget(QtGui.QLabel('@'), 1, 4, 1, 1) self.layoutV.addWidget(self.spb_height_percent, 1, 5, 1, 1) self.layoutV.addWidget(QtGui.QLabel('+'), 1, 6, 1, 1) self.layoutV.addWidget(self.spb_height_units, 1, 7, 1, 1) self.layoutV.addWidget(self.btn_copyBBox_height, 1, 8, 1, 1) # - Set Widget self.setLayout(self.layoutV) self.setWindowTitle('%s %s' % (app_name, app_version)) self.setGeometry(300, 300, 400, 50) self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) # Always on top!! self.show()
#import MP_WorkingCode_turnTableRender # ------------------------------------------------------------------------------ def DSPAssetInfo(): printInfoList = mari.projects.list() print "--------------------------------------" print (printInfoList) print "--------------------------------------" # ------------------------------------------------------------------------------ mainPal = mari.palettes.create("BYU Mari Tools") widget = gui.QWidget() widget.resize(225, 275) mainPal.setBodyWidget(widget) layout = gui.QVBoxLayout() widget.setLayout(layout) layout.addWidget(gui.QLabel("Welcome to the uber palette.")) # ------------------------------------------------------------------------------ #ButtonCreation createProjectPB = gui.QPushButton("Create Project") layout.addWidget(createProjectPB) #connect(createProjectPB.clicked, projectCreate) updateOBJPB = gui.QPushButton("Update OBJs") layout.addWidget(updateOBJPB) #connect(updateOBJPB.clicked, OBJUpdate) ExportMapsPB = gui.QPushButton("Export All Maps") layout.addWidget(ExportMapsPB) #connect(ExportMapsPB.clicked, exportMaps)
def _makeDrillWizard(self): drillWizard = QtGui.QGroupBox('Drill Segmentation') l = QtGui.QVBoxLayout(drillWizard) l.addWidget( _makeButton('segment drill aligned with table', startDrillAutoSegmentationAlignedWithTable)) l.addWidget( _makeButton('segment target using wall center', segmentDrillWallFromWallCenter)) self.drillUpdater = TimerCallback() self.drillUpdater.targetFps = 30 self.drillUpdater.callback = self.moveDrillToHand hw = QtGui.QWidget() hl = QtGui.QHBoxLayout(hw) hl.setMargin(0) self.moveDrillToHandButton = _makeButton('move drill to hand', self.onMoveDrillToHandClicked) self.moveDrillToHandButton.checkable = True hl.addWidget(self.moveDrillToHandButton) self.handCombo = QtGui.QComboBox() self.handCombo.addItem('left') self.handCombo.addItem('right') hl.addWidget(self.handCombo) hl.addWidget(_makeButton('flip z', self.flipDrill)) self.drillFlip = False l.addWidget(hw) # In Degrees self.drillRotationSlider = QtGui.QSlider(QtCore.Qt.Horizontal) self.drillRotationSlider.setMinimum(-90) self.drillRotationSlider.setMaximum(270) self.drillRotationSlider.setValue(90) # All in MM self.drillOffsetSlider = QtGui.QSlider(QtCore.Qt.Horizontal) self.drillOffsetSlider.setMinimum(-100) self.drillOffsetSlider.setMaximum(100) self.drillOffsetSlider.setValue(30) self.drillDepthOffsetSlider = QtGui.QSlider(QtCore.Qt.Horizontal) self.drillDepthOffsetSlider.setMinimum(-10) self.drillDepthOffsetSlider.setMaximum(90) self.drillDepthOffsetSlider.setValue(40) self.drillLateralOffsetSlider = QtGui.QSlider(QtCore.Qt.Horizontal) self.drillLateralOffsetSlider.setMinimum(-50) self.drillLateralOffsetSlider.setMaximum(50) self.drillLateralOffsetSlider.setValue(-23) hw = QtGui.QWidget() hl = QtGui.QHBoxLayout(hw) hl.setMargin(0) hl.addWidget(self.drillRotationSlider) hl.addWidget(self.drillOffsetSlider) hw.connect(self.drillRotationSlider, 'valueChanged(int)', self.moveDrillToHand) hw.connect(self.drillOffsetSlider, 'valueChanged(int)', self.moveDrillToHand) l.addWidget(hw) hw = QtGui.QWidget() hl = QtGui.QHBoxLayout(hw) hl.setMargin(0) hl.addWidget(self.drillDepthOffsetSlider) hl.addWidget(self.drillLateralOffsetSlider) hw.connect(self.drillDepthOffsetSlider, 'valueChanged(int)', self.moveDrillToHand) hw.connect(self.drillLateralOffsetSlider, 'valueChanged(int)', self.moveDrillToHand) l.addWidget(hw) hw = QtGui.QWidget() hl = QtGui.QHBoxLayout(hw) hl.setMargin(0) hl.addWidget( _makeButton('segment button', startDrillButtonSegmentation)) hl.addWidget(_makeButton('segment tip', startPointerTipSegmentation)) self.drillFlip = False l.addWidget(hw) l.addWidget(QtGui.QLabel('')) hw = QtGui.QWidget() hl = QtGui.QHBoxLayout(hw) hl.addWidget(QtGui.QLabel('right angle:')) hl.setMargin(0) self.rightAngleCombo = QtGui.QComboBox() self.rightAngleCombo.addItem(DRILL_TRIANGLE_BOTTOM_LEFT) self.rightAngleCombo.addItem(DRILL_TRIANGLE_BOTTOM_RIGHT) self.rightAngleCombo.addItem(DRILL_TRIANGLE_TOP_LEFT) self.rightAngleCombo.addItem(DRILL_TRIANGLE_TOP_RIGHT) hl.addWidget(self.rightAngleCombo) l.addWidget(hw) l.addWidget( _makeButton('segment drill on table', startDrillAutoSegmentation)) l.addWidget( _makeButton('segment wall', self.segmentDrillWallConstrained)) l.addWidget(_makeButton('refit wall', startRefitWall)) l.addWidget(QtGui.QLabel('')) l.addStretch() return drillWizard
def initGUI(self): self.twiHeadersList = [] self.twiHash = {} self.setWindowTitle("Plugin Manager") # Plugin Table layout = QtGui.QVBoxLayout() self.setLayout(layout) self.pluginDirLabel = QtGui.QLabel(self.PLUGIN_DIR_LABEL_PREFIX) layout.addWidget(self.pluginDirLabel) self.panelSplit = QtGui.QSplitter() self.panelSplit.setOrientation(Qt.Qt.Vertical) layout.addWidget(self.panelSplit) pluginsGroupBox = QtGui.QGroupBox("Plugins") self.panelSplit.addWidget(pluginsGroupBox) pluginsLayout = QtGui.QVBoxLayout() pluginsGroupBox.setLayout(pluginsLayout) self.tableSplit = QtGui.QSplitter() self.tableSplit.setOrientation(Qt.Qt.Horizontal) pluginsLayout.addWidget(self.tableSplit) self.pluginTable = QtGui.QTableWidget() self.tableSplit.addWidget(self.pluginTable) self.setTableHeaders(self.pluginTable, self.PLUGIN_COLUMN_NAMES) self.pluginTable.cellClicked.connect(self.pluginTableCellClicked) self.pluginTable.cellDoubleClicked.connect( self.pluginTableCellDoubleClicked) self.finalizeTable(self.pluginTable) self.metaDataTable = QtGui.QTableWidget() self.tableSplit.addWidget(self.metaDataTable) self.setTableHeaders(self.metaDataTable, ["Key", "Value"]) self.finalizeTable(self.metaDataTable) # Action actionLayout = QtGui.QHBoxLayout() pluginsLayout.addLayout(actionLayout) reloadButton = QtGui.QPushButton("Re-evaluate") reloadButton.clicked.connect(self.reloadButtonClicked) actionLayout.addWidget(reloadButton) refreshButton = QtGui.QPushButton("Refresh") refreshButton.clicked.connect(self.refreshButtonClicked) actionLayout.addWidget(refreshButton) updateAllButton = QtGui.QPushButton("Update All") updateAllButton.clicked.connect(self.updateAllButtonClicked) actionLayout.addWidget(updateAllButton) updateSelectedButton = QtGui.QPushButton("Update Selected") updateSelectedButton.clicked.connect(self.updateSelectedButtonClicked) actionLayout.addWidget(updateSelectedButton) # Log logGroupBox = QtGui.QGroupBox("Log") self.panelSplit.addWidget(logGroupBox) logLayout = QtGui.QVBoxLayout() logGroupBox.setLayout(logLayout) self.logTable = QtGui.QTableWidget() logLayout.addWidget(self.logTable) self.setTableHeaders(self.logTable, ["Date/Time", "Title", "Text"]) self.finalizeTable(self.logTable) # Options optionsGroupBox = QtGui.QGroupBox("Options") self.panelSplit.addWidget(optionsGroupBox) optionsLayout = QtGui.QVBoxLayout() optionsGroupBox.setLayout(optionsLayout) urlLayout = QtGui.QHBoxLayout() optionsLayout.addLayout(urlLayout) urlLayout.addWidget(QtGui.QLabel("Repo List URL")) self.repoLineEdit = QtGui.QLineEdit() urlLayout.addWidget(self.repoLineEdit) mostOptionsLayout = QtGui.QHBoxLayout() optionsLayout.addLayout(mostOptionsLayout) self.quietModeCheckBox = QtGui.QCheckBox("Quiet") mostOptionsLayout.addWidget(self.quietModeCheckBox) self.offlineModeCheckBox = QtGui.QCheckBox("Offline") self.offlineModeCheckBox.stateChanged.connect( self.offlineModeCheckBoxChanged) mostOptionsLayout.addWidget(self.offlineModeCheckBox) self.overwriteSameCheckBox = QtGui.QCheckBox("Overwrite Same Version") mostOptionsLayout.addWidget(self.overwriteSameCheckBox) pluginDirButton = QtGui.QPushButton("Plugin Dir") pluginDirButton.clicked.connect(self.pluginDirButtonClicked) mostOptionsLayout.addWidget(pluginDirButton) self.clearLogButton = QtGui.QPushButton("Clear Log") self.clearLogButton.clicked.connect(self.clearLogButtonClicked) mostOptionsLayout.addWidget(self.clearLogButton) self.saveLogButton = QtGui.QPushButton("Save Log") self.saveLogButton.clicked.connect(self.saveLogButtonClicked) mostOptionsLayout.addWidget(self.saveLogButton) defaultsButton = QtGui.QPushButton("Defaults") defaultsButton.clicked.connect(self.defaultsButtonClicked) mostOptionsLayout.addWidget(defaultsButton) helpButton = QtGui.QPushButton("Help") helpButton.clicked.connect(self.helpButtonClicked) mostOptionsLayout.addWidget(helpButton) # Show self.setWindowFlags(Qt.Qt.Window) self.show() Qt.QApplication.processEvents() self.resize(self.size) return
l = pqt.QGridLayout(w) # Layout to organize widgets w.setLayout(l) w.setWindowTitle("Koenig's Essay Renderer") partBox = pqt.QComboBox(w) srBox = pqt.QComboBox(w) srBox.addItem("44100") srBox.addItem("48000") srBox.addItem("96000") srBox.addItem("192000") sectionBox = pqt.QComboBox(w) renderButton = pqt.QPushButton("Render All",w) stopButton = pqt.QPushButton("Stop Render",w) editButton = pqt.QPushButton("Open in Audacity",w) text = pqt.QTextBrowser(w) statusLabel = pqt.QLabel(w) l.addWidget(pqt.QLabel("Sample Rate"), 0, 0) l.addWidget(srBox, 0, 1) l.addWidget(renderButton, 1, 0) l.addWidget(stopButton, 1, 1) l.addWidget(pqt.QLabel("Select Part"), 2, 0) l.addWidget(partBox, 2, 1) l.addWidget(sectionBox, 3, 0) l.addWidget(editButton, 3, 1) l.addWidget(statusLabel, 4, 0, 1, 2) l.addWidget(text, 5,0,1,2) stopButton.connect("clicked()", stop) renderButton.connect("clicked()", renderFiles) partBox.connect("currentIndexChanged(int)", partChanged) editButton.connect("clicked()", edit)
def __init__(self, visualizer, parent=None): QtGui.QDialog.__init__(self, parent) self.setWindowTitle('Hydroelastic contact visualization settings') self.reset_max_pressure_observed_functor = \ visualizer.reset_max_pressure_observed layout = QtGui.QGridLayout() layout.setColumnStretch(0, 0) layout.setColumnStretch(1, 1) row = 0 # Color map selection. layout.addWidget(QtGui.QLabel('Color map'), row, 0) self.color_map_mode = QtGui.QComboBox() modes = ColorMapModes.get_modes() mode_labels = [ColorMapModes.get_mode_string(m) for m in modes] self.color_map_mode.addItems(mode_labels) self.color_map_mode.setCurrentIndex(visualizer.color_map_mode) mode_tool_tip = 'Determines the mapping from pressures to colors:\n' for m in modes: mode_tool_tip += ' - {}: {}\n'.format( ColorMapModes.get_mode_string(m), ColorMapModes.get_mode_docstring(m)) self.color_map_mode.setToolTip(mode_tool_tip) layout.addWidget(self.color_map_mode, row, 1) row += 1 # Minimum pressure. layout.addWidget(QtGui.QLabel('Minimum pressure'), row, 0) self.min_pressure = QtGui.QLineEdit() self.min_pressure.setToolTip('Pressures at or less than this value ' 'will be visualized as the color defined' ' at the minimum value of the color map ' '(must be at least zero).') self.min_pressure_validator = QtGui.QDoubleValidator( 0, 1e20, 2, self.min_pressure) self.min_pressure_validator.setNotation( QtGui.QDoubleValidator.ScientificNotation) self.min_pressure.setValidator(self.min_pressure_validator) self.min_pressure.setText('{:.3g}'.format(visualizer.min_pressure)) # TODO(seancurtis-TRI) This is supposed to automatically update max # pressure. However, changing min pressure to be larger and then # tabbing out of the widget doesn't necessarily send the # editingFinished signal (whether it is sent appears to be arbitrary). # We need to figure this out before we make a modeless configuration # panel. self.min_pressure.editingFinished.connect(self.update_max_validator) layout.addWidget(self.min_pressure, row, 1) row += 1 # Maximum pressure. layout.addWidget(QtGui.QLabel('Maximum pressure'), row, 0) self.max_pressure = QtGui.QLineEdit() self.max_pressure.setToolTip('Pressures at or greater than this value ' 'will be visualized as the color defined' ' at the maximum value of the color map.') self.max_pressure_validator = QtGui.QDoubleValidator( 0, 1e20, 2, self.max_pressure) self.max_pressure_validator.setNotation( QtGui.QDoubleValidator.ScientificNotation) self.max_pressure.setValidator(self.max_pressure_validator) self.max_pressure.setText('{:.3g}'.format(visualizer.max_pressure)) self.max_pressure.editingFinished.connect(self.update_min_validator) layout.addWidget(self.max_pressure, row, 1) row += 1 # Whether to show pressure. layout.addWidget(QtGui.QLabel('Render contact surface with pressure'), row, 0) self.show_pressure = QtGui.QCheckBox() self.show_pressure.setChecked(visualizer.show_pressure) self.show_pressure.setToolTip('Renders filled-in polygons with ' 'interior coloring representing ' 'pressure using the given color map.') layout.addWidget(self.show_pressure, row, 1) row += 1 # Whether to show the contact surface as a wireframe. layout.addWidget(QtGui.QLabel('Render contact surface wireframe'), row, 0) self.show_contact_edges = QtGui.QCheckBox() self.show_contact_edges.setChecked(visualizer.show_contact_edges) self.show_contact_edges.setToolTip('Renders the edges of the ' 'contact surface.') layout.addWidget(self.show_contact_edges, row, 1) row += 1 contact_data_grp = QtGui.QGroupBox("Contact data") contact_layout = QtGui.QGridLayout() contact_data_grp.setLayout(contact_layout) contact_layout.setColumnStretch(0, 0) contact_layout.setColumnStretch(1, 1) contact_row = 0 layout.addWidget(contact_data_grp, row, 0, 1, 2) row += 1 # Whether to show the force and moment vectors. contact_layout.addWidget( QtGui.QLabel('Render contact force and moment ' 'vectors'), contact_row, 0) self.show_spatial_force = QtGui.QCheckBox() self.show_spatial_force.setChecked(visualizer.show_spatial_force) self.show_spatial_force.setToolTip('Renders the contact forces (in ' 'red) and moments (in blue)') contact_layout.addWidget(self.show_spatial_force, contact_row, 1) contact_row += 1 # Whether to show the per-quadrature-point traction vectors. contact_layout.addWidget(QtGui.QLabel('Render traction vectors'), contact_row, 0) self.show_traction_vectors = QtGui.QCheckBox() self.show_traction_vectors.setChecked(visualizer.show_traction_vectors) self.show_traction_vectors.setToolTip('Renders the traction vectors ' '(per quadrature point) in ' 'magenta') contact_layout.addWidget(self.show_traction_vectors, contact_row, 1) contact_row += 1 # Whether to show the per-quadrature-point slip velocity vectors. contact_layout.addWidget(QtGui.QLabel('Render slip velocity vectors'), contact_row, 0) self.show_slip_velocity_vectors = QtGui.QCheckBox() self.show_slip_velocity_vectors.setChecked( visualizer.show_slip_velocity_vectors) self.show_slip_velocity_vectors.setToolTip('Renders the slip velocity ' 'vectors (per quadrature ' 'point) in cyan') contact_layout.addWidget(self.show_slip_velocity_vectors, contact_row, 1) contact_row += 1 # TODO(DamrongGuoy): The following three widgets "Magnitude # representation", "Global scale", and "Magnitude cut-off" are copied # and modified from show_point_pair_contact.py _ContactConfigDialog(). # We should have both show_hydroelastic_contact.py and # show_point_pair_contact.py share the code instead of duplication. # Furthermore, we should have this setting for each of force, moment, # traction, and slip vectors. See issue #14680. # Magnitude representation layout.addWidget(QtGui.QLabel("Vector scaling mode"), row, 0) self.magnitude_mode = QtGui.QComboBox() modes = ContactVisModes.get_modes() mode_labels = [ContactVisModes.get_mode_string(m) for m in modes] self.magnitude_mode.addItems(mode_labels) self.magnitude_mode.setCurrentIndex(visualizer.magnitude_mode) mode_tool_tip = 'Determines how the magnitude of all hydroelastic ' \ 'vector quantities are visualized:\n' for m in modes: mode_tool_tip += ' - {}: {}\n'.format( ContactVisModes.get_mode_string(m), ContactVisModes.get_mode_docstring(m)) self.magnitude_mode.setToolTip(mode_tool_tip) layout.addWidget(self.magnitude_mode, row, 1) row += 1 # Global scale. layout.addWidget(QtGui.QLabel("Global scale of all vectors"), row, 0) self.global_scale = QtGui.QLineEdit() self.global_scale.setToolTip( 'All visualized vectors are multiplied by this scale factor (must ' 'be non-negative and at most 100). It is dimensionless.') validator = QtGui.QDoubleValidator(0, 100, 3, self.global_scale) validator.setNotation(QtGui.QDoubleValidator.StandardNotation) self.global_scale.setValidator(validator) self.global_scale.setText("{:.3f}".format(visualizer.global_scale)) layout.addWidget(self.global_scale, row, 1) row += 1 # Magnitude cut-off. layout.addWidget(QtGui.QLabel("Minimum vector"), row, 0) self.min_magnitude = QtGui.QLineEdit() self.min_magnitude.setToolTip('Vectors with a magnitude less than ' 'this value will not be visualized ' '(must be > 1e-10 and at most 100') validator = QtGui.QDoubleValidator(1e-10, 100, 10, self.min_magnitude) validator.setNotation(QtGui.QDoubleValidator.StandardNotation) self.min_magnitude.setValidator(validator) self.min_magnitude.setText("{:.3g}".format(visualizer.min_magnitude)) layout.addWidget(self.min_magnitude, row, 1) row += 1 # The maximum pressure value recorded and a button to reset it. self.pressure_value_label = QtGui.QLabel( 'Maximum pressure value observed: {:.5e}'.format( visualizer.max_pressure_observed)) layout.addWidget(self.pressure_value_label, row, 0) reset_button = QtGui.QPushButton('Reset max observed pressure') reset_button.connect('clicked()', self.reset_max_pressure_observed) layout.addWidget(reset_button, row, 1) row += 1 # Accept/cancel. btns = QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel buttons = QtGui.QDialogButtonBox(btns, QtCore.Qt.Horizontal, self) buttons.connect('accepted()', self.accept) buttons.connect('rejected()', self.reject) layout.addWidget(buttons, row, 0, 1, 2) self.setLayout(layout)
from PythonQt import QtCore, QtGui print('Show Set Color Script') # 创建一个窗口 mainWidget = QtGui.QWidget() mainWidget.setWindowTitle("Color Alpha Set") mainLayout = QtGui.QVBoxLayout(mainWidget) # 创建ComboBox topWidget = QtGui.QWidget() mainLayout.addWidget(topWidget) topLayout = QtGui.QHBoxLayout(topWidget) topLabel = QtGui.QLabel("Attribute Name: ") topLayout.addWidget(topLabel) global attrComboBox attrComboBox = QtGui.QComboBox() attrComboBox.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) topLayout.addWidget(attrComboBox) # 创建Slider bottomWidget = QtGui.QWidget() mainLayout.addWidget(bottomWidget) bottomLayout = QtGui.QHBoxLayout(bottomWidget) global bottomLabel bottomLabel = QtGui.QLabel("Alpha(100%): ") bottomLayout.addWidget(bottomLabel) global alphaSlider alphaSlider = QtGui.QSlider(QtCore.Qt.Horizontal) alphaSlider.setMinimum(0)
def __init__(self): super(dlg_generateUnicode, self).__init__() self.n2u = {} # Insert your default folder for custom NAM files self.namFolder = r'' # Set to True if you want to keep Unicodes for glyphs not in the NAM self.keepUnicodes = True # Enter color flag integer if you want to flag modified glyphs, or None self.flagModified = 1 self.f = CurrentFont() self.fPath = self.f.path self.fFolder = os.path.dirname(self.fPath) self.fPathBase = os.path.splitext(os.path.basename(self.fPath))[0] self.fgnu = fontGlyphNameUnicodes(self.f) if not self.namFolder: if fl.userpath: self.namFolder = fl.userpath else: self.namFolder = self.fFolder # -- Flag color selector 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.insertItem(0, 'None') self.cmb_flag.setCurrentIndex(0) # - Options self.chk_keepUnicodes = QtGui.QCheckBox( 'Keep Unicodes for glyphs not in NAM') self.chk_keepUnicodes.setCheckState(QtCore.Qt.Checked) # - Buttons self.btn_open = QtGui.QPushButton('&Open NAM file') self.btn_open.clicked.connect(self.openNamFile) self.btn_save = QtGui.QPushButton('&Save NAM file') self.btn_save.clicked.connect(self.saveNamFile) self.btn_run = QtGui.QPushButton('&Generate Unicodes') self.btn_run.setEnabled(False) self.btn_run.clicked.connect(self.generateUnicodes) # - Build layouts layoutV = QtGui.QVBoxLayout() layoutV.addWidget(self.btn_open) layoutV.addWidget(QtGui.QLabel('Flag modified glyphs:')) layoutV.addWidget(self.cmb_flag) layoutV.addWidget(self.chk_keepUnicodes) layoutV.addWidget(self.btn_run) layoutV.addWidget(self.btn_save) # - Set Widget self.setLayout(layoutV) self.setWindowTitle('%s %s' % (app_name, __version__)) self.setGeometry(300, 300, 220, 120) self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) # Always on top!! self.show()
def ui_n_stuff(self): # Variables necessaires self.geo_list = mari.geo.list() obj = mari.geo.current() obj_name = str(obj.name()) obj_name = obj_name.split("_")[0] self.path_export = "Z:\\Groupes-cours\\NAND999-A15-N01\\Nature\\assets\\tex\\" + obj_name + "\\" self.nomenclature = "$CHANNEL.png" # Construire la fenetre et le layout de base self.setWindowTitle("Export Manager") main_layout = gui.QHBoxLayout(self) close_layout = gui.QVBoxLayout(self) # Layout pour section du top top_group = gui.QGroupBox() top_group_layout = gui.QVBoxLayout() top_group.setLayout(top_group_layout) # Layout pour section du bot bottom_group = gui.QGroupBox() bottom_group_layout = gui.QVBoxLayout() bottom_group.setLayout(bottom_group_layout) # Ajouter Group Widget au main Layout main_layout.addWidget(top_group) main_layout.addWidget(bottom_group) # Channel Header, Label et Widgets channel_label = gui.QLabel("<strong>Channels To Export</strong>") channel_layout = gui.QVBoxLayout() channel_header_layout = gui.QHBoxLayout() # Layout Channel channel_header_layout.addWidget(channel_label) channel_header_layout.addStretch() channel_layout.addLayout(channel_header_layout) top_group_layout.addLayout(channel_layout) # -----------------------------BUTTON & WIDGETS--------------------------------- # Repopulate the earth chan_dict = {} self.checkbox_dict = {} checkbox_liste = [] checkbox_group = gui.QGroupBox() checkbox_group_layout = gui.QVBoxLayout() checkbox_group.setLayout(checkbox_group_layout) top_group_layout.addWidget(checkbox_group) # Label & Checkbox builder geo_dict = {} for geo in self.geo_list: # Iterating over each object (geo = Cube, Sphere, Torus) obj_label = gui.QLabel(str(geo.name())) checkbox_group_layout.addWidget(obj_label) for channel in geo.channelList(): # Iterating over each channel (channel = Diffuse, Spec, Bump...) checkbox = gui.QCheckBox(str(channel.name())) checkbox_group_layout.addWidget(checkbox) self.checkbox_dict[checkbox] = channel # Path Layout path_layout = gui.QHBoxLayout() # Ajouter un label, bouton et text field pour le path path_label = gui.QLabel('Path:') # Label avant le lineEdit path_line_edit = gui.QLineEdit(self.path_export) # Texte sur la ligne path_line_edit.setDisabled(1) path_line_edit.setReadOnly(1) # Read Only mode, can select can't change path_pixmap = gui.QPixmap(mari.resources.path(mari.resources.ICONS) + '/ExportImages.png') icon = gui.QIcon(path_pixmap) path_button = gui.QPushButton(icon, "") path_layout.addWidget(path_label) path_layout.addWidget(path_line_edit) path_layout.addWidget(path_button) bottom_group_layout.addLayout(path_layout) # Select All & Select None Button sel_all = gui.QPushButton("Select All") sel_none = gui.QPushButton("Select None") top_group_layout.addWidget(sel_all) top_group_layout.addWidget(sel_none) sel_all.connect("clicked()", self.select_all) # Connect button to fonction sel_none.connect("clicked()", self.select_none) # Connect button to fonction # Export All & Export Button export_all = gui.QPushButton("Export All") export_selected = gui.QPushButton("Export Selected") bottom_group_layout.addWidget(export_all) bottom_group_layout.addWidget(export_selected) export_all.connect("clicked()", self.export_all_fc) # Connect button to fonction export_selected.connect("clicked()", self.export_selected_fc) # Connect button to fonction # Close button close_btn = gui.QPushButton("Close") close_layout.addWidget(close_btn) main_layout.addLayout(close_layout, stretch=1) close_btn.connect("clicked()", self.reject) # Connect button to fonction
def setupUi(self): #set Main Window Title. self.setWindowTitle("Define New Type") self.setObjectName("xgNewTypeGUI") self.setEnabled(True) self.resize(400, 220) self.centralwidget = QtGui.QWidget() self.centralwidget.setObjectName("centralwidget") self.master_gridLayout = QtGui.QGridLayout(self.centralwidget) self.master_gridLayout.setObjectName("master_gridLayout") self.options_GroupBox = QtGui.QGroupBox("Options", self.centralwidget) self.options_GroupBox.setObjectName("options_GroupBox") self.master_gridLayout.addWidget(self.options_GroupBox, 0, 0, 1, 1) self.main_GridLayout = QtGui.QGridLayout() self.main_GridLayout.setObjectName("main_GridLayout") self.typeName_label = QtGui.QLabel("Texture Type Name: ", self.centralwidget) self.typeName_label.setObjectName("typeName_label") self.main_GridLayout.addWidget(self.typeName_label, 0, 0, 1, 1) self.ok_button = QtGui.QPushButton("OK", self.centralwidget) self.ok_button.setMinimumSize(QtCore.QSize(0, 45)) self.ok_button.setStyleSheet( "QPushButton{background-color: rgb(50, 200, 185); color: rgb(50,50,50)}" ) self.ok_button.setObjectName("ok_button") self.main_GridLayout.addWidget(self.ok_button, 8, 2, 1, 1) self.cancel_Button = QtGui.QPushButton("Cancel", self.centralwidget) self.cancel_Button.setMinimumSize(QtCore.QSize(0, 45)) self.cancel_Button.setObjectName("cancel_Button") self.main_GridLayout.addWidget(self.cancel_Button, 8, 0, 1, 1) self.nameTag_label = QtGui.QLabel("File Name Tag: ", self.centralwidget) self.nameTag_label.setObjectName("nameTag_label") self.main_GridLayout.addWidget(self.nameTag_label, 1, 0, 1, 1) self.dataType_label = QtGui.QLabel("Texture Data Type: ", self.centralwidget) self.dataType_label.setObjectName("dataType_label") self.main_GridLayout.addWidget(self.dataType_label, 5, 0, 1, 1) self.color_radioButton = QtGui.QRadioButton("Color", self.centralwidget) self.color_radioButton.setObjectName("color_radioButton") self.main_GridLayout.addWidget(self.color_radioButton, 5, 2, 1, 1) self.typeName_lineEdit = QtGui.QLineEdit(self.centralwidget) self.typeName_lineEdit.setMinimumSize(QtCore.QSize(0, 30)) self.typeName_lineEdit.setObjectName("typeName_lineEdit") self.typeName_lineEdit.setText("diffuse") self.main_GridLayout.addWidget(self.typeName_lineEdit, 0, 2, 1, 1) self.nameTag_lineEdit = QtGui.QLineEdit(self.centralwidget) self.nameTag_lineEdit.setMinimumSize(QtCore.QSize(0, 30)) self.nameTag_lineEdit.setMaximumSize(QtCore.QSize(100, 16777215)) self.nameTag_lineEdit.setObjectName("nameTag_lineEdit") self.nameTag_lineEdit.setText("col") self.main_GridLayout.addWidget(self.nameTag_lineEdit, 1, 2, 1, 1) self.noncolor_radioButton = QtGui.QRadioButton("Non-Color", self.centralwidget) self.noncolor_radioButton.setObjectName("noncolor_radioButton") self.main_GridLayout.addWidget(self.noncolor_radioButton, 6, 2, 1, 1) self.master_gridLayout.addLayout(self.main_GridLayout, 1, 0, 1, 1) self.setLayout(self.master_gridLayout)
def setupUi(self): #set Main Window Title. self.setWindowTitle("xg Texture Exporter") self.setObjectName("xgTextureExportGUI") self.setEnabled(True) self.resize(545, 702) ##===================================== CentralLayout ============================ self.centralwidget = QtGui.QWidget() self.centralwidget.setObjectName("centralwidget") ##===================================== MasterLayout ============================ self.master_GridLayout = QtGui.QGridLayout(self.centralwidget) self.master_GridLayout.setObjectName("master_GridLayout") ##===================================== TopLayout ============================ self.top_GridLayout = QtGui.QGridLayout() self.top_GridLayout.setObjectName("top_GridLayout") ##=======exportPathLine======## self.exportPathLineEdit = QtGui.QLineEdit(self.centralwidget) self.exportPathLineEdit.setMinimumSize(QtCore.QSize(0, 30)) self.exportPathLineEdit.setObjectName("exportPathLineEdit") self.top_GridLayout.addWidget(self.exportPathLineEdit, 2, 0, 1, 1) ##=======FolderLable=======## self.outputFolderLabel = QtGui.QLabel("Output Folder", self.centralwidget) setBold(self.outputFolderLabel) self.outputFolderLabel.setObjectName("outputFolderLabel") self.top_GridLayout.addWidget(self.outputFolderLabel, 0, 0, 1, 1) ##=======BrowseButton=======## self.browseButton = xgPushButton("browseButton", "Browse", 0, "Choose texture output directory.") self.browseButton.setMinimumSize(QtCore.QSize(0, 30)) self.top_GridLayout.addWidget(self.browseButton, 2, 1, 1, 1) self.master_GridLayout.addLayout(self.top_GridLayout, 0, 0, 1, 1) ##===================================== MidLayout ============================ self.mid_HBoxLayout = QtGui.QHBoxLayout() self.mid_HBoxLayout.setObjectName("mid_HBoxLayout") self.midLeft_GridLayout = QtGui.QGridLayout() self.midLeft_GridLayout.setObjectName("midLeft_GridLayout") ##=======channelsLable=======## self.channels_Label = QtGui.QLabel("Channels", self.centralwidget) setBold(self.channels_Label) self.channels_Label.setObjectName("channels_Label") self.midLeft_GridLayout.addWidget(self.channels_Label, 0, 0, 1, 1) ##=======ChannelButtons=======## self.removeChannel_Button = xgPushButton( "removeChannel_Button", "-", 0, "remove selected channels from export list.") self.removeChannel_Button.setMinimumSize(QtCore.QSize(0, 45)) self.addChannel_Button = xgPushButton( "addChannel_Button", "+", 0, "add selected channels to export list.") self.addChannel_Button.setMinimumSize(QtCore.QSize(0, 45)) self.midLeft_GridLayout.addWidget(self.addChannel_Button, 2, 0, 1, 1) self.midLeft_GridLayout.addWidget(self.removeChannel_Button, 2, 1, 1, 1) ##=======ChannelList=======## self.channelsList_ListWidget = ChannelsToExportList() self.channelsList_ListWidget.isSortingEnabled() self.channelsList_ListWidget.setSortingEnabled(False) self.channelsList_ListWidget.setObjectName("channelsList_ListWidget") QtGui.QListWidgetItem(self.channelsList_ListWidget) self.midLeft_GridLayout.addWidget(self.channelsList_ListWidget, 1, 0, 1, 2) self.mid_HBoxLayout.addLayout(self.midLeft_GridLayout) self.options_GroupBox = QtGui.QGroupBox("Options", self.centralwidget) self.options_GroupBox.setObjectName("options_GroupBox") self.outputFormat_Label = QtGui.QLabel("Output Format :", self.options_GroupBox) self.outputFormat_Label.setGeometry(QtCore.QRect(20, 40, 121, 21)) self.outputFormat_Label.setObjectName("outputFormat_Label") self.resolution_Label = QtGui.QLabel("Resolution:", self.options_GroupBox) self.resolution_Label.setGeometry(QtCore.QRect(20, 70, 121, 21)) self.resolution_Label.setObjectName("resolution_Label") self.processTextures_Label = QtGui.QLabel("process textures:", self.options_GroupBox) self.processTextures_Label.setGeometry(QtCore.QRect(20, 130, 121, 21)) self.processTextures_Label.setObjectName("processTextures_Label") ##=======Options=======## self.outFormat_ComboBox = QtGui.QComboBox(self.options_GroupBox) self.outFormat_ComboBox.setToolTip("define output texture format.") self.outFormat_ComboBox.setGeometry(QtCore.QRect(130, 40, 81, 25)) self.outFormat_ComboBox.setEditable(False) self.outFormat_ComboBox.setObjectName("outFormat_ComboBox") self.outFormat_ComboBox.addItem("exr") self.outFormat_ComboBox.addItem("tif") self.outFormat_ComboBox.setCurrentIndex(1) self.resolution_ComboBox = QtGui.QComboBox(self.options_GroupBox) self.resolution_ComboBox.setToolTip( "define output texture resolution.") self.resolution_ComboBox.setGeometry(QtCore.QRect(100, 70, 111, 25)) self.resolution_ComboBox.setObjectName("resolution_ComboBox") self.resolution_ComboBox.addItem("channel res") self.resolution_ComboBox.addItem("full (8K)") self.resolution_ComboBox.addItem("heigh (4K)") self.resolution_ComboBox.addItem("mid (2K)") self.resolution_ComboBox.addItem("low (1K)") self.clearExpChan_CheckBox = QtGui.QCheckBox("Clear export channels", self.options_GroupBox) self.clearExpChan_CheckBox.setGeometry(QtCore.QRect(20, 100, 181, 23)) self.clearExpChan_CheckBox.setChecked(True) self.clearExpChan_CheckBox.setObjectName("clearExpChan_CheckBox") self.clearExpChan_CheckBox.setToolTip( "delete the flattened channels after export.") self.processTextures_ComboBox = QtGui.QComboBox(self.options_GroupBox) self.processTextures_ComboBox.setToolTip( "define textures processing method.") self.processTextures_ComboBox.setGeometry( QtCore.QRect(135, 130, 105, 25)) self.processTextures_ComboBox.setObjectName("processTextures_ComboBox") self.processTextures_ComboBox.addItem("None") self.processTextures_ComboBox.addItem("Local process") #self.processTextures_ComboBox.addItem("Farm process") #self.texturePublish_CheckBox = QtGui.QCheckBox("Publish farm Textures", self.options_GroupBox) #self.texturePublish_CheckBox.setToolTip("process textures on the farm via texturePublish. \n (convert only will not publish.)") #self.texturePublish_CheckBox.setGeometry(QtCore.QRect(20, 160, 181, 23)) #self.texturePublish_CheckBox.setCheckable(False) #self.texturePublish_CheckBox.setObjectName("texturePublish_CheckBox") ''' self.linear_CheckBox = QtGui.QCheckBox("Local process textures.", self.options_GroupBox) self.linear_CheckBox.setToolTip("convert textures to Mipmap exr localy.") self.linear_CheckBox.setGeometry(QtCore.QRect(20, 130, 181, 23)) #self.linear_CheckBox.setChecked(True) self.linear_CheckBox.setObjectName("linear_CheckBox") self.publish_CheckBox = QtGui.QCheckBox("Publish After Export", self.options_GroupBox) self.publish_CheckBox.setGeometry(QtCore.QRect(20, 190, 181, 23)) self.publish_CheckBox.setCheckable(False) self.publish_CheckBox.setObjectName("publish_CheckBox") ''' self.mid_HBoxLayout.addWidget(self.options_GroupBox) self.master_GridLayout.addLayout(self.mid_HBoxLayout, 1, 0, 1, 1) self.bottom_VBoxLayout = QtGui.QVBoxLayout() self.bottom_VBoxLayout.setObjectName("bottom_VBoxLayout") self.exportChannels_Label = QtGui.QLabel("Channels For Export", self.centralwidget) self.exportChannels_Label.setObjectName("exportChannels_Label") setBold(self.exportChannels_Label) self.bottom_VBoxLayout.addWidget(self.exportChannels_Label) ##======table=======## self.exportChannelsList_tableWidget = QtGui.QTableWidget( self.centralwidget) self.exportChannelsList_tableWidget.setWordWrap(True) self.exportChannelsList_tableWidget.setCornerButtonEnabled(True) #self.exportChannelsList_tableWidget.setRowCount(2) self.exportChannelsList_tableWidget.setObjectName( "exportChannelsList_tableWidget") self.exportChannelsList_tableWidget.setColumnCount(5) self.exportChannelsList_tableWidget.setRowCount(0) self.exportChannelsList_tableWidget.setSelectionBehavior( QtGui.QAbstractItemView.SelectRows) self.exportChannelsList_tableWidget.setSelectionMode( QtGui.QAbstractItemView.SingleSelection) self.exportChannelsList_tableWidget.horizontalHeader().setVisible(True) self.exportChannelsList_tableWidget.horizontalHeader( ).setCascadingSectionResizes(False) self.exportChannelsList_tableWidget.horizontalHeader( ).setMinimumSectionSize(25) self.exportChannelsList_tableWidget.horizontalHeader( ).setSortIndicatorShown(False) #self.exportChannelsList_tableWidget.horizontalHeader().setStretchLastSection(True) self.exportChannelsList_tableWidget.verticalHeader( ).setCascadingSectionResizes(False) self.exportChannelsList_tableWidget.verticalHeader( ).setDefaultSectionSize(28) self.exportChannelsList_tableWidget.verticalHeader( ).setMinimumSectionSize(10) self.itemLine0 = QtGui.QLineEdit("channel") self.item0 = QtGui.QTableWidgetItem(self.itemLine0.text) self.exportChannelsList_tableWidget.setHorizontalHeaderItem( 0, self.item0) self.itemLine1 = QtGui.QLineEdit("type") self.item1 = QtGui.QTableWidgetItem(self.itemLine1.text) self.exportChannelsList_tableWidget.setHorizontalHeaderItem( 1, self.item1) self.itemLine2 = QtGui.QLineEdit("version") self.item2 = QtGui.QTableWidgetItem(self.itemLine2.text) self.exportChannelsList_tableWidget.setHorizontalHeaderItem( 2, self.item2) self.itemLine3 = QtGui.QLineEdit("non_color") self.item3 = QtGui.QTableWidgetItem(self.itemLine3.text) self.exportChannelsList_tableWidget.setHorizontalHeaderItem( 3, self.item3) self.itemLine4 = QtGui.QLineEdit("variation") self.item4 = QtGui.QTableWidgetItem(self.itemLine4.text) self.exportChannelsList_tableWidget.setHorizontalHeaderItem( 4, self.item4) self.exportChannelsList_tableWidget.horizontalHeader( ).setCascadingSectionResizes(False) self.bottom_VBoxLayout.addWidget(self.exportChannelsList_tableWidget) self.exportButton_HBoxLayout = QtGui.QHBoxLayout() self.exportButton_HBoxLayout.setObjectName("exportButton_HBoxLayout") self.cancel_Button = xgPushButton("cancel_Button", "Cancel", 1) self.cancel_Button.setMinimumSize(QtCore.QSize(0, 45)) self.exportButton_HBoxLayout.addWidget(self.cancel_Button) self.exportPatch_Button = xgPushButton("exportPatch_Button", "Export Selected Patches", 1) self.exportPatch_Button.setMinimumSize(QtCore.QSize(200, 45)) self.exportButton_HBoxLayout.addWidget(self.exportPatch_Button) self.export_Button = xgPushButton("export_Button", "Export", 0) self.export_Button.setMinimumSize(QtCore.QSize(200, 45)) self.exportButton_HBoxLayout.addWidget(self.export_Button) self.bottom_VBoxLayout.addLayout(self.exportButton_HBoxLayout) self.master_GridLayout.addLayout(self.bottom_VBoxLayout, 2, 0, 1, 1) self.setLayout(self.master_GridLayout)
def __init__(self, visualizer, show_contact_edges_state, show_pressure_state, show_spatial_force_state, show_traction_vectors_state, show_slip_velocity_vectors_state, max_pressure_observed, reset_max_pressure_observed_functor, parent=None): QtGui.QDialog.__init__(self, parent) self.setWindowTitle('Hydroelastic contact visualization settings') self.reset_max_pressure_observed_functor = \ reset_max_pressure_observed_functor layout = QtGui.QGridLayout() layout.setColumnStretch(0, 0) layout.setColumnStretch(1, 1) row = 0 # Color map selection. layout.addWidget(QtGui.QLabel('Color map'), row, 0) self.color_map_mode = QtGui.QComboBox() modes = ColorMapModes.get_modes() mode_labels = [ColorMapModes.get_mode_string(m) for m in modes] self.color_map_mode.addItems(mode_labels) self.color_map_mode.setCurrentIndex(visualizer.color_map_mode) mode_tool_tip = 'Determines the mapping from pressures to colors:\n' for m in modes: mode_tool_tip += ' - {}: {}\n'.format( ColorMapModes.get_mode_string(m), ColorMapModes.get_mode_docstring(m)) self.color_map_mode.setToolTip(mode_tool_tip) layout.addWidget(self.color_map_mode, row, 1) row += 1 # Minimum pressure. layout.addWidget(QtGui.QLabel('Minimum pressure'), row, 0) self.min_pressure = QtGui.QLineEdit() self.min_pressure.setToolTip('Pressures at or less than this value ' 'will be visualized as the color defined' ' at the minimum value of the color map ' '(must be at least zero).') self.min_pressure_validator = QtGui.QDoubleValidator( 0, 1e20, 2, self.min_pressure) self.min_pressure_validator.setNotation( QtGui.QDoubleValidator.ScientificNotation) self.min_pressure.setValidator(self.min_pressure_validator) self.min_pressure.setText('{:.3g}'.format(visualizer.min_pressure)) # TODO(seancurtis-TRI) This is supposed to automatically update max # pressure. However, changing min pressure to be larger and then # tabbing out of the widget doesn't necessarily send the # editingFinished signal (whether it is sent appears to be arbitrary). # We need to figure this out before we make a modeless configuration # panel. self.min_pressure.editingFinished.connect(self.update_max_validator) layout.addWidget(self.min_pressure, row, 1) row += 1 # Maximum pressure. layout.addWidget(QtGui.QLabel('Maximum pressure'), row, 0) self.max_pressure = QtGui.QLineEdit() self.max_pressure.setToolTip('Pressures at or greater than this value ' 'will be visualized as the color defined' ' at the maximum value of the color map.') self.max_pressure_validator = QtGui.QDoubleValidator( 0, 1e20, 2, self.max_pressure) self.max_pressure_validator.setNotation( QtGui.QDoubleValidator.ScientificNotation) self.max_pressure.setValidator(self.max_pressure_validator) self.max_pressure.setText('{:.3g}'.format(visualizer.max_pressure)) self.max_pressure.editingFinished.connect(self.update_min_validator) layout.addWidget(self.max_pressure, row, 1) row += 1 # Whether to show pressure. layout.addWidget(QtGui.QLabel('Render contact surface with pressure'), row, 0) self.show_pressure = QtGui.QCheckBox() self.show_pressure.setChecked(show_pressure_state) self.show_pressure.setToolTip('Renders filled-in polygons with ' 'interior coloring representing ' 'pressure using the given color map.') layout.addWidget(self.show_pressure, row, 1) row += 1 # Whether to show the contact surface as a wireframe. layout.addWidget(QtGui.QLabel('Render contact surface wireframe'), row, 0) self.show_contact_edges = QtGui.QCheckBox() self.show_contact_edges.setChecked(show_contact_edges_state) self.show_contact_edges.setToolTip('Renders the edges of the ' 'contact surface.') layout.addWidget(self.show_contact_edges, row, 1) row += 1 # Whether to show the force and moment vectors. layout.addWidget(QtGui.QLabel('Render contact forces and moments'), row, 0) self.show_spatial_force = QtGui.QCheckBox() self.show_spatial_force.setChecked(show_spatial_force_state) self.show_spatial_force.setToolTip('Renders the contact forces (in ' 'red) and moments (in blue)') layout.addWidget(self.show_spatial_force, row, 1) row += 1 # Whether to show the per-quadrature-point traction vectors. layout.addWidget(QtGui.QLabel('Render traction vectors'), row, 0) self.show_traction_vectors = QtGui.QCheckBox() self.show_traction_vectors.setChecked(show_traction_vectors_state) self.show_traction_vectors.setToolTip('Renders the traction vectors ' '(per quadrature point) in ' 'magenta') layout.addWidget(self.show_traction_vectors, row, 1) row += 1 # Whether to show the per-quadrature-point slip velocity vectors. layout.addWidget(QtGui.QLabel('Render slip velocity vectors'), row, 0) self.show_slip_velocity_vectors = QtGui.QCheckBox() self.show_slip_velocity_vectors.setChecked( show_slip_velocity_vectors_state) self.show_slip_velocity_vectors.setToolTip('Renders the slip velocity ' 'vectors (per quadrature ' 'point) in cyan') layout.addWidget(self.show_slip_velocity_vectors, row, 1) row += 1 # The maximum pressure value recorded and a button to reset it. self.pressure_value_label = QtGui.QLabel( 'Maximum pressure value observed: {:.5e}'.format( max_pressure_observed)) layout.addWidget(self.pressure_value_label, row, 0) reset_button = QtGui.QPushButton('Reset max observed pressure') reset_button.connect('clicked()', self.reset_max_pressure_observed) layout.addWidget(reset_button, row, 1) row += 1 # Accept/cancel. btns = QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel buttons = QtGui.QDialogButtonBox(btns, QtCore.Qt.Horizontal, self) buttons.connect('accepted()', self.accept) buttons.connect('rejected()', self.reject) layout.addWidget(buttons, row, 0, 1, 2) self.setLayout(layout)
def __init__(self): super(dlg_BuildAxis, self).__init__() # - Init self.active_font = pFont() self.exclude_list = [] # - Widgets self.cmb_master_name = QtGui.QComboBox() self.cmb_axis_name = QtGui.QComboBox() self.cmb_axis_short = QtGui.QComboBox() self.cmb_axis_tag = QtGui.QComboBox() self.spb_italic_angle = QtGui.QSpinBox() self.spb_italic_shift = QtGui.QSpinBox() self.tab_masters = WTableView(table_dict) self.btn_exclude_file = QtGui.QPushButton('Select glyph exclude list') self.btn_populate = QtGui.QPushButton('Populate Master Table') self.btn_execute = QtGui.QPushButton('Execute') self.cmb_master_name.setEditable(True) self.cmb_axis_name.setEditable(True) self.cmb_axis_short.setEditable(True) self.cmb_axis_tag.setEditable(True) self.spb_italic_angle.setMinimum(spinbox_range[0]) self.spb_italic_shift.setMinimum(spinbox_range[0]) self.spb_italic_angle.setMaximum(spinbox_range[1]) self.spb_italic_shift.setMaximum(spinbox_range[1]) self.cmb_master_name.addItems(italic_axis_names_T[0]) self.cmb_axis_name.addItems(italic_axis_names_T[0]) self.cmb_axis_short.addItems(italic_axis_names_T[1]) self.cmb_axis_tag.addItems(italic_axis_names_T[2]) self.spb_italic_angle.setValue(italic_transform_angle) self.spb_italic_shift.setValue(italic_transform_shift) self.cmb_axis_name.currentIndexChanged.connect(self.change_axis_name) self.btn_exclude_file.clicked.connect(self.load_exclude_list) self.btn_populate.clicked.connect(self.table_populate) self.btn_execute.clicked.connect(self.table_execute) # - Build layouts layoutV = QtGui.QGridLayout() layoutV.addWidget(QtGui.QLabel('Build Axis:'), 0, 0, 1, 9, QtCore.Qt.AlignBottom) layoutV.addWidget(QtGui.QLabel('Name:'), 1, 0, 1, 1) layoutV.addWidget(self.cmb_axis_name, 1, 1, 1, 2) layoutV.addWidget(QtGui.QLabel('Short:'), 1, 3, 1, 1) layoutV.addWidget(self.cmb_axis_short, 1, 4, 1, 2) layoutV.addWidget(QtGui.QLabel('Tag:'), 1, 6, 1, 1) layoutV.addWidget(self.cmb_axis_tag, 1, 7, 1, 2) layoutV.addWidget(QtGui.QLabel('Masters:'), 2, 0, 1, 2, QtCore.Qt.AlignBottom) layoutV.addWidget(QtGui.QLabel('Transformation:'), 2, 2, 1, 3, QtCore.Qt.AlignBottom) layoutV.addWidget(QtGui.QLabel('Suffix:'), 3, 0, 1, 1) layoutV.addWidget(self.cmb_master_name, 3, 1, 1, 2) layoutV.addWidget(QtGui.QLabel('Angle:'), 3, 3, 1, 1) layoutV.addWidget(self.spb_italic_angle, 3, 4, 1, 2) layoutV.addWidget(QtGui.QLabel('Shift:'), 3, 6, 1, 1) layoutV.addWidget(self.spb_italic_shift, 3, 7, 1, 2) layoutV.addWidget(QtGui.QLabel('Glyph processing:'), 5, 0, 1, 9, QtCore.Qt.AlignBottom) layoutV.addWidget(self.btn_exclude_file, 6, 0, 1, 9) layoutV.addWidget(QtGui.QLabel('Overview:'), 7, 0, 1, 9, QtCore.Qt.AlignBottom) layoutV.addWidget(self.btn_populate, 8, 0, 1, 9) layoutV.addWidget(self.tab_masters, 9, 0, 25, 9) layoutV.addWidget(self.btn_execute, 34, 0, 1, 9) # - Set Widget self.setLayout(layoutV) self.setWindowTitle('%s %s' % (app_name, app_version)) self.setGeometry(300, 300, 400, 600) self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) # Always on top!! self.show()
def spawnBasicLabel(txt="<>"): qs = QtGui.QLabel(txt) qs.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) qs.setStyleSheet(LABEL_DEFAULT_STYLE_SHEET) return qs
def __init__(self): super(dlg_copyMetrics, 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 Metric values') self.btn_pasteADV = QtGui.QPushButton( '&Paste Metric values: LSB, Advance') self.btn_pasteRSB = QtGui.QPushButton('&Paste Metric values: LSB, RSB') self.btn_export = QtGui.QPushButton('&Export to File (TypeRig *.json)') self.btn_import = QtGui.QPushButton( '&Import from File (TypeRig *.json)') self.btn_importAFM = QtGui.QPushButton( '&Import from Adobe Font Metrics (*.AFM)') self.btn_importAFM.setEnabled(False) self.btn_copy.clicked.connect(self.copyExpr) self.btn_pasteADV.clicked.connect(lambda: self.pasteExpr(sbMode=False)) self.btn_pasteRSB.clicked.connect(lambda: self.pasteExpr(sbMode=True)) self.btn_export.clicked.connect(self.exportExpr) self.btn_import.clicked.connect(self.importExpr) self.btn_importAFM.clicked.connect(self.importExprAFM) self.btn_pasteADV.setEnabled(False) self.btn_pasteRSB.setEnabled(False) #self.btn_export.setEnabled(False) #self.btn_import.setEnabled(False) # - Build layouts layoutV = QtGui.QVBoxLayout() layoutV.addWidget(QtGui.QLabel('Copy/Paste metrics 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_pasteADV) layoutV.addWidget(self.btn_pasteRSB) layoutV.addWidget(self.btn_export) layoutV.addWidget(self.btn_import) layoutV.addWidget(self.btn_importAFM) # - Set Widget self.setLayout(layoutV) self.setWindowTitle('%s %s' % (app_name, app_version)) self.setGeometry(300, 300, 280, 140) self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) # Always on top!! self.show()
def spawnBasicLabel(txt="<>"): qs = QtGui.QLabel(txt) qs.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding) qs.setStyleSheet(LABEL_DEFAULT_STYLE_SHEET) qs.setAlignment(QtCore.Qt.AlignHCenter) return qs
def build_gui(self): self.setWindowFlags(Qt.Qt.Window) layout = QtGui.QGridLayout() layout.setSpacing(10) # Window layout #layout = QtGui.QVBoxLayout() self.setLayout(layout) self.show_button_neurite = QtGui.QPushButton('Show neurite') self.show_button_selected_neurite = QtGui.QPushButton( 'Add selected neurite(s)') self.show_button_synapse = QtGui.QPushButton('Show synapse') self.clear_knossos_view_button = QtGui.QPushButton('Clear view') self.ssv_selector = QtGui.QListView() self.ssv_selector.setUniformItemSizes(True) # better performance self.ssv_item_model = QtGui.QStandardItemModel(self.ssv_selector) self.syn_selector = QtGui.QListView() self.syn_selector.setUniformItemSizes(True) # better performance self.syn_item_model = QtGui.QStandardItemModel(self.syn_selector) self.direct_ssv_id_input = QtGui.QLineEdit() self.direct_ssv_id_input.setValidator(QtGui.QIntValidator()) self.direct_ssv_id_input.setMaxLength(8) self.direct_syn_id_input = QtGui.QLineEdit() self.direct_syn_id_input.setValidator(QtGui.QIntValidator()) self.direct_syn_id_input.setMaxLength(8) # celltype self.celltype_field = QtGui.QLabel("CellType: ", self) # synapse self.synapse_field1 = QTableWidget() self.synapse_field1.setRowCount(5) self.synapse_field1.setColumnCount(2) self.synapse_field1.setItem(0, 0, QTableWidgetItem("coordinate")) self.synapse_field1.setItem(0, 1, QTableWidgetItem("")) self.synapse_field1.setItem(1, 0, QTableWidgetItem("synaptic type")) self.synapse_field1.setItem(1, 1, QTableWidgetItem("")) self.synapse_field1.setItem(2, 0, QTableWidgetItem("syn. proba.")) self.synapse_field1.setItem(2, 1, QTableWidgetItem("")) self.synapse_field1.setItem(3, 0, QTableWidgetItem("size [um^2]")) self.synapse_field1.setItem(3, 1, QTableWidgetItem("")) self.synapse_field1.setItem(4, 0, QTableWidgetItem("Object ID")) self.synapse_field1.setItem(4, 1, QTableWidgetItem("")) # self.synapse_field1.setEditTriggers(QtWidgets.QTableWidget.NoEditTriggers) # qt5 header = self.synapse_field1.horizontalHeader() header.setSectionResizeMode(0, QtGui.QHeaderView.Stretch) header.setSectionResizeMode(1, QtGui.QHeaderView.ResizeToContents) self.synapse_field1.setEditTriggers( QtGui.QAbstractItemView.NoEditTriggers) self.synapse_field2 = QTableWidget() self.synapse_field2.setRowCount(5) self.synapse_field2.setColumnCount(3) # TODO: sort by pre and post in 'on_syn_selector_changed' and replace neuron1 and neuron2 by pre and post self.synapse_field2.setItem(0, 1, QTableWidgetItem("neuron 1")) self.synapse_field2.setItem(0, 2, QTableWidgetItem("neuron 2")) self.synapse_field2.setItem(1, 0, QTableWidgetItem("SSV ID")) self.synapse_field2.setItem(2, 0, QTableWidgetItem("cell type")) self.synapse_field2.setItem(3, 0, QTableWidgetItem("cell comp.")) self.synapse_field2.setItem(4, 0, QTableWidgetItem("spiness")) # self.synapse_field2.setEditTriggers(QtWidgets.QTableWidget.NoEditTriggers) # qt5 self.synapse_field2.setEditTriggers( QtGui.QAbstractItemView.NoEditTriggers) header = self.synapse_field2.horizontalHeader() header.setSectionResizeMode(0, QtGui.QHeaderView.Stretch) header.setSectionResizeMode(1, QtGui.QHeaderView.ResizeToContents) header.setSectionResizeMode(2, QtGui.QHeaderView.ResizeToContents) self.send_synapsetype_label_button = QtGui.QPushButton('Send') self.synapsetype_label = QtGui.QLabel() self.synapsetype_label.setText( "Synapse type label [-1: inhib.; 0: non-syn.; 1: " "excit.]:") self.synapsetype_label_text = QtGui.QLineEdit() self.send_button_response_label = QtGui.QLabel() self.send_button_response_label.setText(None) #self.exploration_mode_chk_box = QtGui.QCheckBox('Exploration mode') #self.exploration_mode_chk_box.setChecked(True) #self.ssv_selection_model = # QtGui.QItemSelectionModel(self.ssv_select_model) #self.selectionModel = # self.ssv_selector.selectionModel(self.ssv_selector) #self.ssv_selector.setSelectionModel(self.ssv_selection_model) #print('selection model: ' + str(self.ssv_selector.selectionModel())) self.ssv_selector.clicked.connect(self.on_ssv_selector_changed) self.syn_selector.clicked.connect(self.on_syn_selector_changed) self.populate_ssv_list() self.populate_syn_list() print('Connected to SyConnGate.') layout.addWidget(self.direct_ssv_id_input, 1, 0, 1, 1) layout.addWidget(self.direct_syn_id_input, 1, 1, 1, 1) layout.addWidget(self.ssv_selector, 2, 0, 1, 1) layout.addWidget(self.syn_selector, 2, 1, 1, 1) layout.addWidget(self.show_button_neurite, 3, 0, 1, 1) layout.addWidget(self.show_button_synapse, 3, 1, 1, 1) layout.addWidget(self.clear_knossos_view_button, 4, 0, 1, 1) layout.addWidget(self.show_button_selected_neurite, 5, 0, 1, 1) layout.addWidget(self.celltype_field, 1, 2, 1, 2) layout.addWidget(self.synapse_field1, 2, 2, 1, 1) layout.addWidget(self.synapse_field2, 3, 2, 1, 1) layout.addWidget(self.synapsetype_label, 4, 1, 1, 1) layout.addWidget(self.synapsetype_label_text, 4, 2, 1, 2) layout.addWidget(self.send_button_response_label, 5, 1, 1, 1) layout.addWidget(self.send_synapsetype_label_button, 5, 2, 1, 1) #self.ssv_select_model.itemChanged.connect(self.on_ssv_selector_changed) #self.selectionModel.selectionChanged.connect(self.on_ssv_selector_changed) self.show_button_neurite.clicked.connect( self.show_button_neurite_clicked) self.show_button_selected_neurite.clicked.connect( self.show_button_selected_neurite_clicked) self.show_button_synapse.clicked.connect( self.show_button_synapse_clicked) self.clear_knossos_view_button.clicked.connect( self.clear_knossos_view_button_clicked) self.send_synapsetype_label_button.clicked.connect( self.send_synapsetype_label_button_clicked) #self.exploration_mode_chk_box.stateChanged.connect(self.exploration_mode_changed) # self.setGeometry(300, 300, 450, 300) self.setWindowTitle('SyConn Viewer v2') self.show()
def ui_variables(self): # -----------------------------Boring stuff (AKA VARIABLES ET FONCTIONS)----------------- self.geo_list = mari.geo.list() self.sel_obj = mari.geo.current() self.chk_dict = {} self.chk_liste = [] self.maps_combobox_list = [] self.build_all_checkbox_value = 0 self.build_selected_checkbox_value = 0 diff_chk = gui.QCheckBox("Diffuse", self) bump_chk = gui.QCheckBox("Bump", self) disp_chk = gui.QCheckBox("Displacement", self) spec_chk = gui.QCheckBox("Specular", self) norm_chk = gui.QCheckBox("Normal", self) roug_chk = gui.QCheckBox("Roughness", self) refl_chk = gui.QCheckBox("Reflection", self) refr_chk = gui.QCheckBox("Refraction", self) fres_chk = gui.QCheckBox("Fresnel", self) mask_chk = gui.QCheckBox("Mask", self) self.chk_liste = [ diff_chk, bump_chk, disp_chk, spec_chk, norm_chk, roug_chk, refl_chk, refr_chk, fres_chk, mask_chk ] self.chk_liste_name = [ "diff_chk", "bump_chk", "disp_chk", "spec_chk", "norm_chk", "roug_chk", "refl_chk", "refr_chk", "fres_chk", "mask_chk" ] # -----------------------------Base Layout---------------------------------------------- self.setWindowTitle("Channel Builder") main_layout = gui.QHBoxLayout(self) # Map Checkbox Layout left_group = gui.QGroupBox(self) self.channel_layout = gui.QGridLayout() left_group.setLayout(self.channel_layout) self.lbl = gui.QLabel("<b>Channels To Build</b>") self.channel_layout.addWidget(self.lbl) self.channel_layout.setColumnMinimumWidth(1, 5) # Middle Layout self.mid_group = gui.QGroupBox(self) self.mid_group_layout = gui.QVBoxLayout(self) self.mid_group.setLayout(self.mid_group_layout) # Add Layout to main main_layout.addWidget(left_group) main_layout.addWidget(self.mid_group) # -----------------------------Buttons, Checkbox, and stuff.... you know....------------ # Add Checkbox pour Map et Set to layout temp = 0 for checkbox in self.chk_liste: self.size_for_map = gui.QComboBox() self.size_for_map.insertItem( 0, "1024", ) self.size_for_map.insertItem( 1, "2048", ) self.size_for_map.insertItem( 2, "4096", ) self.size_for_map.insertItem( 3, "8192", ) # self.size_for_map.insertItem(4, "16384", ) #PEUT-ETRE DISPONIBLE UN JOUR QUI SAIT ;_; self.channel_layout.addWidget(self.chk_liste[temp]) self.channel_layout.addWidget(self.size_for_map) temp_name = self.chk_liste_name[temp] temp = temp + 1 self.chk_dict[temp_name] = self.size_for_map self.maps_combobox_list.append(self.size_for_map) # Select All & Select None sel_all = gui.QPushButton("Select All") sel_none = gui.QPushButton("Select None") self.channel_layout.addWidget(sel_all) self.channel_layout.addWidget(sel_none) sel_all.connect("clicked()", self.select_all) sel_none.connect("clicked()", self.select_none) # Build Selected build_selected = gui.QPushButton( "Build Selected") # Bouton Build Selected self.build_selected_same_size_chkbox = gui.QCheckBox( "Use same size for all maps?") self.build_selected_size_combobox = gui.QComboBox() self.build_selected_groupbox = gui.QGroupBox(self) # Creation du cadre self.build_selected_layout = gui.QGridLayout(self) # Layout du cadre self.build_selected_groupbox.setLayout( self.build_selected_layout) # Attribuer le layout au cadre self.build_selected_layout.addWidget( build_selected) # Ajouter bouton au layout self.build_selected_layout.addWidget( self.build_selected_same_size_chkbox) # Ajouter checkbox au layout self.build_selected_layout.addWidget( self.build_selected_size_combobox) # AJouter combobox au layout self.build_selected_size_combobox.insertItem( 0, "1024", ) # Ajouter resolution 1024 self.build_selected_size_combobox.insertItem( 1, "2048", ) # Ajouter resolution 2048 self.build_selected_size_combobox.insertItem( 2, "4096", ) # Ajouter resolution 4096 self.build_selected_size_combobox.insertItem( 3, "8192", ) # Ajouter resolution 8192 self.build_selected_size_combobox.setDisabled(1) self.mid_group_layout.addWidget( self.build_selected_groupbox ) # Ajouter le cadre au layout du milieu build_selected.connect("clicked()", self.build_selected_fc) self.build_selected_same_size_chkbox.connect( "clicked()", self.lock_build_selected_combobox) # Build All build_all = gui.QPushButton("Build All") # Bouton Build All self.build_all_same_size_chkbox = gui.QCheckBox( "Use same size for all maps?") self.build_all_size_combobox = gui.QComboBox() self.build_all_groupbox = gui.QGroupBox(self) # Création du cadre self.build_all_layout = gui.QGridLayout(self) # Layout du cadre self.build_all_groupbox.setLayout( self.build_all_layout) # Attribuer le layout au cadre self.build_all_layout.addWidget( build_all) # Ajouter le bouton au layout self.build_all_layout.addWidget( self.build_all_same_size_chkbox) # Ajouter le checkbox au layout self.build_all_layout.addWidget( self.build_all_size_combobox) # Ajouter la combobox au layout self.build_all_size_combobox.insertItem( 0, "1024", ) # Ajouter resolution 1024 self.build_all_size_combobox.insertItem( 1, "2048", ) # Ajouter resolution 2048 self.build_all_size_combobox.insertItem( 2, "4096", ) # Ajouter resolution 4096 self.build_all_size_combobox.insertItem( 3, "8192", ) # Ajouter resolution 8192 self.build_all_size_combobox.setDisabled(1) self.mid_group_layout.addWidget( self.build_all_groupbox) # Ajouter le cadre au Layout du milieu build_all.connect("clicked()", self.build_all_fc) # Connect bouton a fonction self.build_all_same_size_chkbox.connect("clicked()", self.lock_build_all_combobox)
def __init__(self, msg): super(message, self).__init__() self.warnMessage = QtGui.QLabel(msg) self.warnMessage.setOpenExternalLinks(True) self.warnMessage.setWordWrap(True) self.addWidget(self.warnMessage)
def __init__(self): super(dlg_CopyLayer, self).__init__() # - Init self.active_font = pFont() self.pMode = 0 # - Basic Widgets self.tab_masters = WTableView(table_dict) self.table_populate() self.edt_checkStr = QtGui.QLineEdit() self.edt_checkStr.setPlaceholderText('DST string') self.edt_checkStr.setToolTip('Enter search criteria for selectively selecting destination masters.') self.btn_refresh = QtGui.QPushButton('Clear') self.btn_checkOn = QtGui.QPushButton('Select') self.btn_execute = QtGui.QPushButton('Execute Selection') self.btn_preset_contrast = QtGui.QPushButton('Copy to Contrast Masters') self.btn_preset_width = QtGui.QPushButton('Copy to Width Masters') self.btn_preset_weight = QtGui.QPushButton('Copy to Weight Masters') self.btn_refresh.clicked.connect(self.table_populate) self.btn_checkOn.clicked.connect(lambda: self.table_populate(True)) self.btn_execute.clicked.connect(self.execute_table) self.btn_preset_contrast.clicked.connect(lambda: self.execute_preset(copy_presets['contrast'])) self.btn_preset_width.clicked.connect(lambda: self.execute_preset(copy_presets['width'])) self.btn_preset_weight.clicked.connect(lambda: self.execute_preset(copy_presets['weight'])) self.rad_glyph = QtGui.QRadioButton('Glyph') self.rad_window = QtGui.QRadioButton('Window') self.rad_selection = QtGui.QRadioButton('Selection') self.rad_font = QtGui.QRadioButton('Font') self.chk_outline = QtGui.QCheckBox('Outline') self.chk_guides = QtGui.QCheckBox('Guides') self.chk_anchors = QtGui.QCheckBox('Anchors') self.chk_lsb = QtGui.QCheckBox('LSB') self.chk_adv = QtGui.QCheckBox('Advance') self.chk_rsb = QtGui.QCheckBox('RSB') self.chk_lnk = QtGui.QCheckBox('Metric Links') self.chk_crlayer = QtGui.QCheckBox('Add layers') # -- Set States self.chk_outline.setCheckState(QtCore.Qt.Checked) self.chk_adv.setCheckState(QtCore.Qt.Checked) self.chk_lsb.setCheckState(QtCore.Qt.Checked) self.chk_anchors.setCheckState(QtCore.Qt.Checked) self.chk_lnk.setCheckState(QtCore.Qt.Checked) self.chk_crlayer.setCheckState(QtCore.Qt.Checked) self.chk_guides.setEnabled(False) self.rad_glyph.setChecked(True) self.rad_glyph.setEnabled(True) self.rad_window.setEnabled(True) self.rad_selection.setEnabled(True) self.rad_font.setEnabled(False) self.rad_glyph.toggled.connect(self.refreshMode) self.rad_window.toggled.connect(self.refreshMode) self.rad_selection.toggled.connect(self.refreshMode) self.rad_font.toggled.connect(self.refreshMode) # - Build layouts layoutV = QtGui.QGridLayout() layoutV.addWidget(QtGui.QLabel('Process Mode:'), 0, 0, 1, 8, QtCore.Qt.AlignBottom) layoutV.addWidget(self.rad_glyph, 1, 0, 1, 2) layoutV.addWidget(self.rad_window, 1, 2, 1, 2) layoutV.addWidget(self.rad_selection, 1, 4, 1, 2) layoutV.addWidget(self.rad_font, 1, 6, 1, 2) layoutV.addWidget(QtGui.QLabel('Copy Options:'), 2, 0, 1, 8, QtCore.Qt.AlignBottom) layoutV.addWidget(self.chk_outline, 3, 0, 1, 2) layoutV.addWidget(self.chk_guides, 3, 2, 1, 2) layoutV.addWidget(self.chk_anchors, 3, 4, 1, 2) layoutV.addWidget(self.chk_crlayer, 3, 6, 1, 2) layoutV.addWidget(self.chk_lsb, 4, 0, 1, 2) layoutV.addWidget(self.chk_adv, 4, 2, 1, 2) layoutV.addWidget(self.chk_rsb, 4, 4, 1, 2) layoutV.addWidget(self.chk_lnk, 4, 6, 1, 2) layoutV.addWidget(QtGui.QLabel('Master Layers: Single source to multiple destinations'), 5, 0, 1, 8, QtCore.Qt.AlignBottom) layoutV.addWidget(QtGui.QLabel('Search:'), 6, 0, 1, 1) layoutV.addWidget(self.edt_checkStr, 6, 1, 1, 3) layoutV.addWidget(self.btn_checkOn, 6, 4, 1, 2) layoutV.addWidget(self.btn_refresh, 6, 6, 1, 2) layoutV.addWidget(self.tab_masters, 7, 0, 15, 8) layoutV.addWidget(self.btn_execute, 22, 0, 1,8) layoutV.addWidget(QtGui.QLabel('Master Layers: Copy Presets'), 23, 0, 1, 8, QtCore.Qt.AlignBottom) layoutV.addWidget(self.btn_preset_weight, 24, 0, 1,8) layoutV.addWidget(self.btn_preset_width, 25, 0, 1,8) layoutV.addWidget(self.btn_preset_contrast, 26, 0, 1,8) # - Set Widget self.setLayout(layoutV) self.setWindowTitle('%s %s' %(app_name, app_version)) self.setGeometry(300, 300, 300, 600) self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) # Always on top!! self.show()