How to use the taurus.external.qt.Qt.QModelIndex function in taurus

To help you get started, we’ve selected a few taurus examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github taurus-org / taurus / lib / taurus / qt / qtgui / extra_guiqwt / curvesmodel.py View on Github external
    def rowCount(self, index=Qt.QModelIndex()):
        return len(self.curves)
github taurus-org / taurus / src / sardana / taurus / qt / qtgui / extra_macroexecutor / macroparameterseditor / model.py View on Github external
def index(self, row, column, parent):
        if not parent.isValid():
            parentNode = self.root();
        else:
            parentNode = parent.internalPointer()
        childNode = parentNode.child(row)
        if childNode is None:
            return Qt.QModelIndex();
        else:
            return self.createIndex(row, column, childNode);
github taurus-org / taurus / taurus / lib / taurus / qt / qtgui / plot / curveprops.py View on Github external
    def rowCount(self,index=Qt.QModelIndex()):
        return len(self.curves)
github sardana-org / sardana / src / sardana / taurus / qt / qtgui / extra_macroexecutor / sequenceeditor / sequenceeditor.py View on Github external
def expanded(self):
        for column in range(self.model().columnCount(Qt.QModelIndex())):
            self.resizeColumnToContents(column)
github taurus-org / taurus / src / sardana / taurus / qt / qtgui / extra_macroexecutor / sequenceeditor / model.py View on Github external
def parent(self, child):
        node = self.nodeFromIndex(child)
        if node is None:
            return Qt.QModelIndex()
        parent = node.parent()
        if parent is None:
            return Qt.QModelIndex()
        grandparent = parent.parent()
        if grandparent is None:
            return Qt.QModelIndex()
        row = grandparent.rowOfChild(parent)
        assert row != -1
        return self.createIndex(row, 0, parent)
github sardana-org / sardana / src / sardana / taurus / qt / qtgui / extra_macroexecutor / macroparameterseditor / model.py View on Github external
def parent(self, child):
        node = self.nodeFromIndex(child)
        if node is None:
            return Qt.QModelIndex()
        parent = node.parent()
        if parent is None or isinstance(parent, macro.SequenceNode):
            return Qt.QModelIndex()
        grandparent = parent.parent()
        if grandparent is None:
            return Qt.QModelIndex()
        row = grandparent.rowOfChild(parent)
        return self.createIndex(row, 0, parent)
github taurus-org / taurus / lib / taurus / qt / qtgui / table / qlogtable.py View on Github external
    def insertRows(self, position, rows=1, index=Qt.QModelIndex()):
        self.beginInsertRows(Qt.QModelIndex(), position, position + rows - 1)
        self.endInsertRows()
github sardana-org / sardana / src / sardana / taurus / qt / qtgui / extra_macroexecutor / sequenceeditor / sequenceeditor.py View on Github external
def setRangeForMacro(self, macroId, range):
        persistentIndex = self._idIndexDict.get(macroId, None)
        if persistentIndex is None:
            return
        index = Qt.QModelIndex(persistentIndex)
        node = self.model().nodeFromIndex(index)
        node.setRange(range)
github sardana-org / sardana / src / sardana / taurus / qt / qtgui / extra_macroexecutor / favouriteseditor / model.py View on Github external
def index(self, row, column=0, parent=Qt.QModelIndex()):
        if self.rowCount():
            return self.createIndex(row, column, self.list[row])
        else:
            return Qt.QModelIndex()
github taurus-org / taurus / taurus / lib / taurus / qt / qtgui / table / qlogtable.py View on Github external
def removeRows(self, position, rows=1, index=Qt.QModelIndex()):
        self.beginRemoveRows(Qt.QModelIndex(), position, position+rows-1)
        self.endRemoveRows()