Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def onRemoveSelectedColumns(self):
self.extraColumnsTable.removeRows()
self.emit(Qt.SIGNAL("modelChanged()"))
def setModel(self, model):
try: self.ioreg_dev = taurus.Device(model)
except: return
self.alias_label.setModel('%s/State?configuration=dev_alias' % model)
self.value_label.setModel(model)
# Empty previous buttons
#self.ui.lo_buttons_write.
for button in self.button_value_dict.keys():
self.disconnect(button, Qt.SIGNAL('clicked'), self.writeValue)
button.deleteLater()
self.button_value_dict = {}
labels = self.ioreg_dev.getAttribute('Labels').read().value
labels_list = labels.split(' ')
# Update the mapping
for label_and_value in labels_list:
label, value = label_and_value.split(':')
button = Qt.QPushButton(label)
self.button_value_dict[button] = value
self.ui.lo_buttons_write.addWidget(button)
self.connect(button, Qt.SIGNAL('clicked()'), self.writeValue)
def run(self):
self.log.debug("run... - TaurusGraphicsUpdateThread")
emitter = Qt.QObject()
emitter.moveToThread(Qt.QApplication.instance().thread())
emitter.setParent(Qt.QApplication.instance())
Qt.QObject.connect(emitter, Qt.SIGNAL("updateView"), self._updateView)
p = self.parent()
while True:
item = p.getQueue().get(True)
if type(item) in types.StringTypes:
if item == "exit":
break
else:
continue
if not operator.isSequenceType(item):
item = (item,)
item_rects = [ i.boundingRect() for i in item ]
for v in p.views():
#p.info("emit('updateView')")
emitter.emit(Qt.SIGNAL("updateView"), v)
def __init__(self, parent=None, paramModel=None):
ParamBase.__init__(self, paramModel)
Qt.QWidget.__init__(self,parent)
self.setToolTip(self.paramModel().description())
self.layout = Qt.QHBoxLayout(self)
self.layout.setContentsMargins(0,0,0,0)
self.filePath = Qt.QLineEdit(self)
self.layout.addWidget(self.filePath)
self.button = Qt.QPushButton(self)
self.button.setText("...")
self.layout.addWidget(self.button)
self.text = ""
Qt.QObject.connect(self.button,Qt.SIGNAL("clicked()"),self._chooseAFile)
def __init__(self, parent=None):
Qt.QDialog.__init__(self, parent)
self.ui = ui = ui_SendMailForm.Ui_SendMailForm()
ui.setupUi(self)
self.connect(ui.buttonBox, Qt.SIGNAL("accepted()"), self.accept)
self.connect(ui.buttonBox, Qt.SIGNAL("rejected()"), self.reject)
self.ui.editMessage.setFont(Qt.QFont("Monospace"))
layout = Qt.QVBoxLayout()
layout.setContentsMargins(0, 0, 0, 0)
self.setLayout(layout)
self._panel = MacroTreeWidget(parent=self, perspective=perspective,
designMode=designMode,
with_navigation_bar=False)
self._panel.setModel(model_name)
self.setWindowIcon(getElementTypeIcon(self._panel.perspective()))
self._buttonBox = Qt.QDialogButtonBox(self)
bts = Qt.QDialogButtonBox.Ok | Qt.QDialogButtonBox.Cancel
self._buttonBox.setStandardButtons(bts)
layout.addWidget(self._panel)
layout.addWidget(self._buttonBox)
self.connect(self._buttonBox, Qt.SIGNAL("accepted()"), self.accept)
self.connect(self._buttonBox, Qt.SIGNAL("rejected()"), self.reject)
addNewColumnButton = Qt.QPushButton(getThemeIcon("list-add") ,"Add new column...", self)
removeSelectedColumnsButton = Qt.QPushButton(getThemeIcon("list-remove") ,"Remove selected...", self)
buttonsLayout = Qt.QHBoxLayout()
buttonsLayout.addWidget(addNewColumnButton)
buttonsLayout.addWidget(removeSelectedColumnsButton)
self.layout().addLayout(buttonsLayout)
self.extraColumnsTable = ExtraColumnsTable(self)
self.extraColumnsModel = ExtraColumnsModel()
self.extraColumnsTable.setModel(self.extraColumnsModel)
self.extraColumnsTable.setItemDelegate(ExtraColumnsDelegate(self.extraColumnsTable))
self.layout().addWidget(self.extraColumnsTable)
self.connect(addNewColumnButton, Qt.SIGNAL("clicked()"), self.onAddNewColumn)
self.connect(removeSelectedColumnsButton, Qt.SIGNAL("clicked()"), self.onRemoveSelectedColumns)
self.connect(self.extraColumnsModel, Qt.SIGNAL("dataChanged (const QModelIndex&,const QModelIndex&)"), self.onExtraColumnsChanged)
self.connect(self.extraColumnsModel, Qt.SIGNAL("modelReset()"), self.onExtraColumnsChanged)
self.setEditTriggers(Qt.QAbstractItemView.AllEditTriggers)
self.addAction = Qt.QAction(getThemeIcon("list-add"), "Add new repetition", self)
self.connect(self.addAction, Qt.SIGNAL("triggered()"), self.onAddRepeat)
self.addAction.setToolTip("Clicking this button will add new repetition to current parameter.")
self.deleteAction = Qt.QAction(getThemeIcon("list-remove"), "Remove repetition", self)
self.connect(self.deleteAction, Qt.SIGNAL("triggered()"), self.onDelRepeat)
self.deleteAction.setToolTip("Clicking this button will remove current repetition.")
self.moveUpAction = Qt.QAction(getThemeIcon("go-up"), "Move up", self)
self.connect(self.moveUpAction, Qt.SIGNAL("triggered()"), self.onUpRepeat)
self.moveUpAction.setToolTip("Clicking this button will move current repetition up.")
self.moveDownAction = Qt.QAction(getThemeIcon("go-down"), "Move down", self)
self.connect(self.moveDownAction, Qt.SIGNAL("triggered()"), self.onDownRepeat)
self.moveDownAction.setToolTip("Clicking this button will move current repetition down.")
self.disableActions()
def initComponents(self):
self.setLayout(Qt.QFormLayout())
self.layout().addRow(Qt.QLabel("Setting environment variable:", self))
self.nameComboBox = ComboBoxParam(self)
self.nameComboBox.addItems(["ActiveMntGrp", "ExtraColumns", "JsonRecorder", "ScanFile", "ScanDir"])
self.nameComboBox.setEditable(True)
self.connect(self.nameComboBox, Qt.SIGNAL("currentIndexChanged(int)"), self.onNameComboBoxChanged)
self.layout().addRow("name:", self.nameComboBox)
nameIndex = self.model().index(0, 1, self.rootIndex())
self.nameComboBox.setIndex(nameIndex)
def setModel(self, model):
TaurusWidget.setModel(self, model)
if self.door is not None:
self.disconnect(self.door, Qt.SIGNAL('macroStatusUpdated'), self.statusUpdated)
self.disconnect(self.door, Qt.SIGNAL('resultUpdated'), self.resultUpdated)
self.door.getAttribute('State').removeListener(self.door_state_listener)
try: self.door = taurus.Device(model)
except: return
self.connect(self.door, Qt.SIGNAL('macroStatusUpdated'), self.statusUpdated)
self.connect(self.door, Qt.SIGNAL('resultUpdated'), self.resultUpdated)
# Manage Door Tango States
self.door_state_listener = DoorStateListener()
self.connect(self.door_state_listener, Qt.SIGNAL('doorStateChanged'), self.doorStateChanged)
self.door.getAttribute('State').addListener(self.door_state_listener)