コード例 #1
0
    def mapSelectionToSource(self, proxySelection):
        sourceSelection = QItemSelection()
        if self.sourceModel() is None:
            return sourceSelection

        cursor = proxySelection.constBegin()
        end = proxySelection.constEnd()
        while cursor != end:
            topLeft = self.mapToSource(cursor.topLeft())
            bottomRight = self.mapToSource(cursor.bottomRight())
            sourceRange = QItemSelectionRange(topLeft, bottomRight)
            sourceSelection.append(sourceRange)
            cursor += 1
        return sourceSelection
コード例 #2
0
ファイル: _pyside_missing.py プロジェクト: dnaudet/silx
    def mapSelectionToSource(self, proxySelection):
        sourceSelection = QItemSelection()
        if self.sourceModel() is None:
            return sourceSelection

        cursor = proxySelection.constBegin()
        end = proxySelection.constEnd()
        while cursor != end:
            topLeft = self.mapToSource(cursor.topLeft())
            bottomRight = self.mapToSource(cursor.bottomRight())
            sourceRange = QItemSelectionRange(topLeft, bottomRight)
            sourceSelection.append(sourceRange)
            cursor += 1
        return sourceSelection
コード例 #3
0
    def mapSelectionFromSource(self, sourceSelection):
        proxySelection = QItemSelection()
        if self.sourceModel() is None:
            return proxySelection

        cursor = sourceSelection.constBegin()
        end = sourceSelection.constEnd()
        while cursor != end:
            topLeft = self.mapFromSource(cursor.topLeft())
            bottomRight = self.mapFromSource(cursor.bottomRight())
            proxyRange = QItemSelectionRange(topLeft, bottomRight)
            proxySelection.append(proxyRange)
            cursor += 1
        return proxySelection
コード例 #4
0
ファイル: _pyside_missing.py プロジェクト: dnaudet/silx
    def mapSelectionFromSource(self, sourceSelection):
        proxySelection = QItemSelection()
        if self.sourceModel() is None:
            return proxySelection

        cursor = sourceSelection.constBegin()
        end = sourceSelection.constEnd()
        while cursor != end:
            topLeft = self.mapFromSource(cursor.topLeft())
            bottomRight = self.mapFromSource(cursor.bottomRight())
            proxyRange = QItemSelectionRange(topLeft, bottomRight)
            proxySelection.append(proxyRange)
            cursor += 1
        return proxySelection