PythonQt.Qt.QItemSelection
QItemSelection
PythonQtInstanceWrapper object
Native bases: PythonQtInstanceWrapper
Supplemental documentation: Qt 5 reference:
Detailed Description
A QItemSelection describes the items in a model that have been selected by the user. A QItemSelection is basically a list of selection ranges, see QItemSelectionRange. It provides functions for creating and manipulating selections, and selecting a range of items from a model.
The QItemSelection class is one of the Model/View Classes and is part of Qt's model/view framework.
An item selection can be constructed and initialized to contain a range of items from an
existing model. The following example constructs a selection that contains a range of
items from the given model, beginning at the topLeft, and ending at the
bottomRight.
QItemSelection *selection = new QItemSelection(topLeft, bottomRight);
An empty item selection can be constructed, and later populated as required. So, if the model is going to be unavailable when we construct the item selection, we can rewrite the above code in the following way:
QItemSelection *selection = new QItemSelection();
...
selection->select(topLeft, bottomRight);
QItemSelection saves memory, and avoids unnecessary work, by working with selection ranges rather than recording the model item index for each item in the selection. Generally, an instance of this class will contain a list of non-overlapping selection ranges.
Use merge() to merge one item selection into another without making overlapping ranges. Use split() to split one selection range into smaller ranges based on a another selection range.
Source: https://doc.qt.io/archives/qt-5.15/qitemselection.html
Complete member index
Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.
| Member | Kind | Signature | Summary |
|---|---|---|---|
__init__ |
function | (self, *args: Any, **kwargs: Any) -> None |
Native constructor; consult class documentation for supported overloads. (shared captured text) |
append |
function | (self, t: Any) -> None |
(shared captured text) |
at |
function | (self, i: int) -> Any |
X.at(i) -> PythonQt.QtGui.QItemSelectionRange (shared captured text) |
back |
function | (self) -> Any |
X.back() -> PythonQt.QtGui.QItemSelectionRange (shared captured text) |
className |
function | (self, *args: Any, **kwargs: Any) -> Any |
Return the classname of the object (shared captured text) |
clear |
function | (self) -> None |
(shared captured text) |
constFirst |
function | (self) -> Any |
X.constFirst() -> PythonQt.QtGui.QItemSelectionRange (shared captured text) |
constLast |
function | (self) -> Any |
X.constLast() -> PythonQt.QtGui.QItemSelectionRange (shared captured text) |
contains |
function | (self, index: Any) -> bool |
X.contains(index) -> bool (shared captured text) |
count |
function | (self, t: Any) -> int |
X.count(t) -> int (shared captured text) |
delete |
function | (self, *args: Any, **kwargs: Any) -> Any |
Deletes the C++ object (at your own risk, my friend!) (shared captured text) |
detachShared |
function | (self) -> None |
(shared captured text) |
empty |
function | (self) -> bool |
X.empty() -> bool (shared captured text) |
endsWith |
function | (self, t: Any) -> bool |
X.endsWith(t) -> bool (shared captured text) |
first |
function | (self) -> Any |
X.first() -> PythonQt.QtGui.QItemSelectionRange (shared captured text) |
fromVector |
function | (self, vector: Any) -> tuple |
X.fromVector(vector) -> tuple (shared captured text) |
front |
function | (self) -> Any |
X.front() -> PythonQt.QtGui.QItemSelectionRange (shared captured text) |
help |
function | (self, *args: Any, **kwargs: Any) -> Any |
Shows the help of available methods for this class (shared captured text) |
indexOf |
function | (self, *args: Any, **kwargs: Any) -> int |
X.indexOf(t, from) -> int (shared captured text) |
indexes |
function | (self) -> tuple |
X.indexes() -> tuple (shared captured text) |
inherits |
function | (self, *args: Any, **kwargs: Any) -> Any |
Returns if the class inherits or is of given type name (shared captured text) |
isEmpty |
function | (self) -> bool |
X.isEmpty() -> bool (shared captured text) |
isSharedWith |
function | (self, other: Any) -> bool |
X.isSharedWith(other) -> bool (shared captured text) |
last |
function | (self) -> Any |
X.last() -> PythonQt.QtGui.QItemSelectionRange (shared captured text) |
lastIndexOf |
function | (self, *args: Any, **kwargs: Any) -> int |
X.lastIndexOf(t, from) -> int (shared captured text) |
length |
function | (self) -> int |
X.length() -> int (shared captured text) |
merge |
function | (self, other: Any, command: Any) -> None |
X.merge(other, command) (shared captured text) |
mid |
function | (self, pos: int, length: int) -> tuple |
X.mid(pos, length) -> tuple (shared captured text) |
move |
function | (self, *args: Any, **kwargs: Any) -> None |
X.move(from, to) (shared captured text) |
pop_back |
function | (self) -> None |
(shared captured text) |
pop_front |
function | (self) -> None |
(shared captured text) |
prepend |
function | (self, t: Any) -> None |
(shared captured text) |
push_back |
function | (self, t: Any) -> None |
(shared captured text) |
push_front |
function | (self, t: Any) -> None |
(shared captured text) |
removeAll |
function | (self, t: Any) -> int |
X.removeAll(t) -> int (shared captured text) |
removeAt |
function | (self, i: int) -> None |
(shared captured text) |
removeFirst |
function | (self) -> None |
(shared captured text) |
removeLast |
function | (self) -> None |
(shared captured text) |
removeOne |
function | (self, t: Any) -> bool |
X.removeOne(t) -> bool (shared captured text) |
replace |
function | (self, i: int, t: Any) -> None |
X.replace(i, t) (shared captured text) |
reserve |
function | (self, size: int) -> None |
(shared captured text) |
select |
function | (self, topLeft: Any, bottomRight: Any) -> None |
X.select(topLeft, bottomRight) (shared captured text) |
setSharable |
function | (self, sharable: bool) -> None |
(shared captured text) |
size |
function | (self) -> int |
X.size() -> int (shared captured text) |
split |
function | (self, range: Any, other: Any, result: Any) -> None |
X.split(range, other, result) (shared captured text) |
startsWith |
function | (self, t: Any) -> bool |
X.startsWith(t) -> bool (shared captured text) |
swap |
function | (self, i: Any, j: Any) -> None |
X.swap(i, j) (shared captured text) |
takeAt |
function | (self, i: int) -> Any |
X.takeAt(i) -> PythonQt.QtGui.QItemSelectionRange (shared captured text) |
takeFirst |
function | (self) -> Any |
X.takeFirst() -> PythonQt.QtGui.QItemSelectionRange (shared captured text) |
takeLast |
function | (self) -> Any |
X.takeLast() -> PythonQt.QtGui.QItemSelectionRange (shared captured text) |
toVector |
function | (self) -> tuple |
X.toVector() -> tuple (shared captured text) |
value |
function | (self, i: int, defaultValue: Any) -> Any |
X.value(i, defaultValue) -> PythonQt.QtGui.QItemSelectionRange (shared captured text) |