def setup(self): QtGui.QShortcut(QtGui.QKeySequence("Ctrl+W"), self.widget).connect( QtCore.SIGNAL("activated()"), self.close ) QtGui.QShortcut(QtGui.QKeySequence("Ctrl+Q"), self.widget).connect( QtCore.SIGNAL("activated()"), self.close ) self.capturePanel = CapturePanel(self) self.sendPosturePanel = SendPosturePanel(self)
def setup(self): self.ui.captureButton.connect(QtCore.SIGNAL("clicked()"), self.onCaptureClicked) self.ui.groupCombo.connect( QtCore.SIGNAL("currentIndexChanged(const QString&)"), self.onGroupComboChanged, ) self.updateGroupCombo() self.initCaptureMethods() jointSetNames = getJointSets().keys() updateComboStrings(self.ui.jointSetCombo, jointSetNames, jointSetNames[0])
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 __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 setup(self): self.ui.postureFilter.hide() self.ui.postureFilterLabel.hide() self.ui.sendLeftButton.connect(QtCore.SIGNAL('clicked()'), self.onLeftClicked) self.ui.sendRightButton.connect(QtCore.SIGNAL('clicked()'), self.onRightClicked) self.ui.sendDefaultButton.connect(QtCore.SIGNAL('clicked()'), self.onDefaultClicked) self.ui.sendPostureGroupCombo.connect( QtCore.SIGNAL('currentIndexChanged(const QString&)'), self.onGroupComboChanged) self.ui.postureListWidget.connect( QtCore.SIGNAL('currentRowChanged(int)'), self.onPostureSelected) self.updateGroupCombo() self.updatePostureListWidget()
def showDialog(mainWindow): loader = QtUiTools.QUiLoader() uifile = QtCore.QFile(':/vvResources/vvAboutDialog.ui') if not uifile.open(uifile.ReadOnly): print("Canno't open the ui for the about dialog.") return dialog = loader.load(uifile, mainWindow) uifile.close() dialog.setModal(True) def w(name): for widget in dialog.children(): if widget.objectName == name: return widget image = w('splashLabel') splash = image.pixmap.scaled(image.pixmap.width()/2.0, image.pixmap.height()/2.0) image.setPixmap(splash) image.adjustSize() appName = mainWindow.windowTitle.split(" ")[0] appVersionTag = mainWindow.windowTitle.split(" ")[1] appBitTag = mainWindow.windowTitle.split(" ")[2] dialog.windowTitle = "About " + appName + " ..." copyrightText = '''<h1>{0} {1} {2}</h1><br/> Copyright (c) 2017, Velodyne Lidar, Copyright (c) 2017, Kitware<br /> Provided by <a href="http://velodynelidar.com/">Velodyne Lidar</a>, coded by <a href="https://www.kitware.com/">Kitware</a>.<br /> <br /> Sample Data Repository: <a href="http://midas3.kitware.com/midas/community/29">http://midas3.kitware.com/midas/community/29</a> '''.format(appName, appVersionTag, appBitTag) w('copyrightLabel').setText(copyrightText) textBoxContent = '''<h4>Want more ? Ask Kitware !</h4> Kitware Inc. is a leading provider of open-source software systems for technical and scientific computing. We are the developers of VeloView, providing real-time interactive visualization of live captured 3D LiDAR data from Velodyne's sensors. We create customized solutions providing detection and tracking of people, street signs, lane markings, vehicles, industrial machinery, and building facades from within VeloView or using combinations of point cloud and video data. We also provide Lidar-based SLAM algorithms for other Velodyne's integrators. We work with customers to create tailored solutions using proven open-source technologies, avoiding vendor lock-in and leveraging our world-leading experience in visualization, computer vision, high-performance computing, and test-driven high-quality software process.<br /> <br /> <br /> Have a look at <a href="https://www.kitware.com/our-expertise/">our expertise</a>, and for more information, please contact us: <a href="mailto:[email protected]?subject=Contact+about+VeloView">[email protected]</a> ''' w('detailsLabel').setText(textBoxContent) button = w('closeButton') closeIcon = QtGui.QApplication.style().standardIcon(QtGui.QStyle.SP_DialogCloseButton) button.setIcon(closeIcon) button.connect(button, QtCore.SIGNAL('clicked()'), dialog, QtCore.SLOT('close()')) dialog.adjustSize() dialog.setFixedSize(dialog.size) dialog.exec_()
def __init__(self, plugin): super(QCPWidget, self).__init__(plugin) self.plugin = plugin layout = QtGui.QVBoxLayout(self) from PythonQt.QCustomPlot import QCustomPlot, QCP self.qcpWidget = QCustomPlot() self.qcpWidget.autoAddPlottableToLegend = True self.qcpWidget.setInteraction(QCP.iRangeDrag, True) # iRangeDrap self.qcpWidget.setInteraction(QCP.iRangeZoom, True) # iRangeZoom self.qcpWidget.setInteraction(QCP.iSelectAxes, True) # iSelectAxes self.qcpWidget.legend().visible = True layout.addWidget(self.qcpWidget, 1) self.qcpWidget.connect(Qt.SIGNAL("mouseDoubleClick(QMouseEvent*)"), self._mouseDoubleClick) self.qcpWidget.xAxis().connect( Qt.SIGNAL("selectionChanged(QCPAxis::SelectableParts)"), self._axesSelectionChanged) self.qcpWidget.yAxis().connect( Qt.SIGNAL("selectionChanged(QCPAxis::SelectableParts)"), self._axesSelectionChanged) buttonbar = QtGui.QWidget() bbLayout = QtGui.QHBoxLayout(buttonbar) button = QtGui.QPushButton("Replot", buttonbar) button.connect(QtCore.SIGNAL("clicked()"), self.refreshPlot) bbLayout.addWidget(button) button = QtGui.QPushButton("Remove", buttonbar) button.connect(QtCore.SIGNAL("clicked()"), self.removePlot) bbLayout.addWidget(button) button = QtGui.QPushButton("Legend", buttonbar) button.checkable = True button.checked = True button.connect(QtCore.SIGNAL("toggled(bool)"), self.toggleLegend) bbLayout.addWidget(button) button = QtGui.QPushButton(QtGui.QIcon.fromTheme("zoom-fit-best"), "", buttonbar) button.setToolTip("Zoom fit best") button.connect(QtCore.SIGNAL("clicked()"), self.qcpWidget.rescaleAxes) bbLayout.addWidget(button) self.xselect = QtGui.QComboBox(self) bbLayout.addWidget(self.xselect, 1) layout.addWidget(buttonbar) self.data = DataQCP(plugin, self.qcpWidget)
def makeLeftPane (self, layout): layout.addWidget (QtGui.QLabel ("Select Y data")) refresh = QtGui.QPushButton ("Refresh", self) refresh.connect (QtCore.SIGNAL("clicked()"), self.refreshPlot) layout.addWidget (refresh) self.scrollArea = QtGui.QScrollArea (self) layout.addWidget (self.scrollArea)
def makeLeftPane(self, layout): #button = QtGui.QPushButton ("Refresh", self) #button.connect (QtCore.SIGNAL("clicked()"), self.refreshPlot) #layout.addWidget (button) button = QtGui.QPushButton("Add plot below", self) button.connect(QtCore.SIGNAL("clicked()"), self.addPlotBelow) layout.addWidget(button) layout.addWidget(QtGui.QLabel("Select Y data")) self.scrollArea = QtGui.QScrollArea(self) layout.addWidget(self.scrollArea)
def convert(self): uiFile = self.uiNameEdit.text if (len(uiFile) < 3): #nothing inserted QtGui.QMessageBox.critical( 0, "Error", "ui file name is not inserted! I don't know, what to handle. Sorry." ) return self.insertMessageBox = QtGui.QMessageBox( QtGui.QMessageBox.Information, "Insert", "Place cursor where you would like the code to be pasted") self.insertMessageBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) self.insertMessageBox.setModal(False) # don't block QtCore.QObject.connect( self.insertMessageBox.button(self.insertMessageBox.Ok), QtCore.SIGNAL("clicked()"), self.insertText) self.insertMessageBox.setWindowFlags( self.insertMessageBox.windowFlags() | QtCore.Qt.WindowStaysOnTopHint) # on top until a buttin is pressed self.insertMessageBox.show()
def launchRefresh(self): print("Auto Refreshed Launched") self.timer = QtCore.QTimer() self.timer.connect(self.timer, QtCore.SIGNAL("timeout()"), self.createAllGraph) self.timer.start(1000)
def __init__ (self, action, joint, velocities, parent): super(JointAction, self).__init__ (action, parent) self.joint = joint self.velocities = velocities self.connect (QtCore.SIGNAL('triggered(bool)'), self.trigger)
def disconnect(self): if self.connected: self.plugin.main.disconnect(QtCore.SIGNAL('applyCurrentConfiguration()'), self.applyAll) self.connected = False
def connect(self): if not self.connected: self.plugin.pathPlayer.setRobotVelocity(True) self.plugin.main.connect(QtCore.SIGNAL('applyCurrentConfiguration()'), self.applyAll) self.connected = True
def setupUi(self, Dialog): Dialog.setObjectName(_fromUtf8("Create UI with QtDesigner")) Dialog.setMinimumSize(QtCore.QSize(300, 200)) self.frame = QtGui.QFrame(Dialog) self.frame.setGeometry(QtCore.QRect(4, 4, 268, 63)) self.frame.setObjectName(_fromUtf8("frame")) self.keepPyBox = QtGui.QCheckBox(Dialog) self.keepPyBox.setGeometry(QtCore.QRect(166, 98, 117, 21)) self.keepPyBox.setObjectName(_fromUtf8("keepPyBox")) self.addPyrunBox = QtGui.QCheckBox(Dialog) self.addPyrunBox.setGeometry(QtCore.QRect(21, 98, 141, 21)) self.addPyrunBox.setObjectName(_fromUtf8("addPyrunBox")) self.convertButton = QtGui.QCommandLinkButton(Dialog) self.convertButton.setGeometry(QtCore.QRect(70, 130, 168, 41)) self.convertButton.setObjectName(_fromUtf8("convertButton")) self.line = QtGui.QFrame(Dialog) self.line.setGeometry(QtCore.QRect(21, 80, 262, 16)) self.line.setFrameShape(QtGui.QFrame.HLine) self.line.setFrameShadow(QtGui.QFrame.Sunken) self.line.setObjectName(_fromUtf8("line")) self.layoutWidget = QtGui.QWidget(Dialog) self.layoutWidget.setGeometry(QtCore.QRect(20, 20, 260, 53)) self.layoutWidget.setObjectName(_fromUtf8("layoutWidget")) self.gridLayout = QtGui.QGridLayout(self.layoutWidget) self.gridLayout.setMargin(0) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.label = QtGui.QLabel(self.layoutWidget) self.label.setObjectName(_fromUtf8("label")) self.gridLayout.addWidget(self.label, 0, 0, 1, 1) self.uiNameEdit = QtGui.QLineEdit(self.layoutWidget) self.uiNameEdit.setObjectName(_fromUtf8("uiNameEdit")) self.gridLayout.addWidget(self.uiNameEdit, 0, 1, 1, 3) self.newButton = QtGui.QPushButton(self.layoutWidget) icon = QtGui.QIcon.fromTheme(_fromUtf8("document-new")) self.newButton.setIcon(icon) self.newButton.setObjectName(_fromUtf8("newButton")) self.gridLayout.addWidget(self.newButton, 1, 0, 1, 2) self.openButton = QtGui.QPushButton(self.layoutWidget) icon = QtGui.QIcon.fromTheme(_fromUtf8("document-open")) self.openButton.setIcon(icon) self.openButton.setObjectName(_fromUtf8("openButton")) self.gridLayout.addWidget(self.openButton, 1, 2, 1, 1) self.designButton = QtGui.QPushButton(self.layoutWidget) self.designButton.setToolTip(_fromUtf8("")) self.designButton.setWhatsThis(_fromUtf8("")) icon = QtGui.QIcon.fromTheme(_fromUtf8("applications-engineering")) self.designButton.setIcon(icon) self.designButton.setObjectName(_fromUtf8("designButton")) self.gridLayout.addWidget(self.designButton, 1, 3, 1, 1) self.layoutWidget1 = QtGui.QWidget(Dialog) self.layoutWidget1.setGeometry(QtCore.QRect(0, 0, 2, 2)) self.layoutWidget1.setObjectName(_fromUtf8("layoutWidget1")) self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget1) self.verticalLayout.setMargin(0) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.splitter = QtGui.QSplitter(Dialog) self.splitter.setGeometry(QtCore.QRect(0, 0, 0, 0)) self.splitter.setOrientation(QtCore.Qt.Horizontal) self.splitter.setObjectName(_fromUtf8("splitter")) self.retranslateUi(Dialog) QtCore.QObject.connect(self.designButton, QtCore.SIGNAL(_fromUtf8("clicked()")), self.runDesigner) QtCore.QObject.connect(self.convertButton, QtCore.SIGNAL(_fromUtf8("clicked()")), self.convert) QtCore.QObject.connect(self.openButton, QtCore.SIGNAL(_fromUtf8("clicked()")), self.openDialog) QtCore.QObject.connect(self.newButton, QtCore.SIGNAL(_fromUtf8("clicked()")), self.newDialog)