PythonQt.QtCore.QBitArray · declarations 001
Back to PythonQt.QtCore.QBitArray
at
at(i: int) -> bool
X.at(i) -> bool
Supplemental documentation: Qt 5 reference:
bool QBitArray::at(int i) const
Returns the value of the bit at index position i.
i must be a valid index position in the bit array (i.e., 0 \<\= i \< size()).
See also operator[]().
Upstream PySide2 reference signatures (binding differences may apply):
at(self, i: int) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qbitarray.html#at
clear
clear() -> None
X.clear()
Supplemental documentation: Qt 5 reference:
void QBitArray::clear()
Clears the contents of the bit array and makes it empty.
See also resize() and isEmpty().
Upstream PySide2 reference signatures (binding differences may apply):
clear(self) -> None
Source: https://doc.qt.io/archives/qt-5.15/qbitarray.html#clear
clearBit
clearBit(i: int) -> None
X.clearBit(i)
Supplemental documentation: Qt 5 reference:
void QBitArray::clearBit(int i)
Sets the bit at index position i to 0.
i must be a valid index position in the bit array (i.e., 0 \<\= i \< size()).
See also setBit() and toggleBit().
Upstream PySide2 reference signatures (binding differences may apply):
clearBit(self, i: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qbitarray.html#clearBit
count
count(on: Any) -> int
X.count(on) -> int
Supplemental documentation: Qt 5 reference:
int QBitArray::count() const
Same as size().
int QBitArray::count(bool on) const
If on is true, this function returns the number of 1-bits stored in the bit array; otherwise the number of 0-bits is returned.
Upstream PySide2 reference signatures (binding differences may apply):
count(self) -> int
count(self, on: bool) -> int
Source: https://doc.qt.io/archives/qt-5.15/qbitarray.html#count
fill
fill(val: bool, first: Any, last: Any) -> Any
X.fill(val, first, last)
Supplemental documentation: Qt 5 reference:
bool QBitArray::fill(bool value, int size \= -1)
Sets every bit in the bit array to value, returning true if successful; otherwise
returns false. If size is different from -1 (the default), the bit array is resized
to size beforehand.
Example:
QBitArray ba(8);
ba.fill(true);
// ba: [ 1, 1, 1, 1, 1, 1, 1, 1 ]
ba.fill(false, 2);
// ba: [ 0, 0 ]
See also resize().
void QBitArray::fill(bool value, int begin, int end)
This is an overloaded function.
Sets bits at index positions begin up to (but not including) end to value.
begin must be a valid index position in the bit array (0 \<\= begin \< size()).
end must be either a valid index position or equal to size(), in which case the fill operation runs until the end of the array (0 \<\= end \<\= size()).
Example:
QBitArray ba(4);
ba.fill(true, 1, 2); // ba: [ 0, 1, 0, 0 ]
ba.fill(true, 1, 3); // ba: [ 0, 1, 1, 0 ]
ba.fill(true, 1, 4); // ba: [ 0, 1, 1, 1 ]
Upstream PySide2 reference signatures (binding differences may apply):
fill(self, val: bool, first: int, last: int) -> None
fill(self, val: bool, size: int=...) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qbitarray.html#fill
isEmpty
isEmpty() -> bool
X.isEmpty() -> bool
Supplemental documentation: Qt 5 reference:
bool QBitArray::isEmpty() const
Returns true if this bit array has size 0; otherwise returns false.
See also size().
Upstream PySide2 reference signatures (binding differences may apply):
isEmpty(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qbitarray.html#isEmpty
isNull
isNull() -> bool
X.isNull() -> bool
Supplemental documentation: Qt 5 reference:
bool QBitArray::isNull() const
Returns true if this bit array is null; otherwise returns false.
Example:
QBitArray().isNull(); // returns true
QBitArray(0).isNull(); // returns false
QBitArray(3).isNull(); // returns false
Qt makes a distinction between null bit arrays and empty bit arrays for historical reasons. For most applications, what matters is whether or not a bit array contains any data, and this can be determined using isEmpty().
See also isEmpty().
Upstream PySide2 reference signatures (binding differences may apply):
isNull(self) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qbitarray.html#isNull
operator_assign
operator_assign(other: Any) -> Any
X.operator_assign(other) -> PythonQt.QtCore.QBitArray
readFrom
readFrom(arg__1: Any) -> Any
X.readFrom(arg__1)
resize
resize(size: int) -> None
X.resize(size)
Supplemental documentation: Qt 5 reference:
void QBitArray::resize(int size)
Resizes the bit array to size bits.
If size is greater than the current size, the bit array is extended to make it size bits with the extra bits added to the end. The new bits are initialized to false (0).
If size is less than the current size, bits are removed from the end.
See also size().
Upstream PySide2 reference signatures (binding differences may apply):
resize(self, size: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qbitarray.html#resize
setBit
setBit(i: int, val: Any) -> None
X.setBit(i, val)
Supplemental documentation: Qt 5 reference:
void QBitArray::setBit(int i)
Sets the bit at index position i to 1.
i must be a valid index position in the bit array (i.e., 0 \<\= i \< size()).
See also clearBit() and toggleBit().
void QBitArray::setBit(int i, bool value)
This is an overloaded function.
Sets the bit at index position i to value.
Upstream PySide2 reference signatures (binding differences may apply):
setBit(self, i: int) -> None
setBit(self, i: int, val: bool) -> None
Source: https://doc.qt.io/archives/qt-5.15/qbitarray.html#setBit
size
size() -> int
X.size() -> int
Supplemental documentation: Qt 5 reference:
int QBitArray::size() const
Returns the number of bits stored in the bit array.
See also resize().
Upstream PySide2 reference signatures (binding differences may apply):
size(self) -> int
Source: https://doc.qt.io/archives/qt-5.15/qbitarray.html#size
swap
swap(other: Any) -> None
X.swap(other)
Supplemental documentation: Qt 5 reference:
void QBitArray::swap(QBitArray \&other)
Swaps bit array other with this bit array. This operation is very fast and never fails.
This function was introduced in Qt 4.8.
Upstream PySide2 reference signatures (binding differences may apply):
swap(self, other: PySide2.QtCore.QBitArray) -> None
Source: https://doc.qt.io/archives/qt-5.15/qbitarray.html#swap
testBit
testBit(i: int) -> bool
X.testBit(i) -> bool
Supplemental documentation: Qt 5 reference:
bool QBitArray::testBit(int i) const
Returns true if the bit at index position i is 1; otherwise returns false.
i must be a valid index position in the bit array (i.e., 0 \<\= i \< size()).
See also setBit() and clearBit().
Upstream PySide2 reference signatures (binding differences may apply):
testBit(self, i: int) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qbitarray.html#testBit
toggleBit
toggleBit(i: int) -> bool
X.toggleBit(i) -> bool
Supplemental documentation: Qt 5 reference:
bool QBitArray::toggleBit(int i)
Inverts the value of the bit at index position i, returning the previous value of that bit as either true (if it was set) or false (if it was unset).
If the previous value was 0, the new value will be 1. If the previous value was 1, the new value will be 0.
i must be a valid index position in the bit array (i.e., 0 \<\= i \< size()).
See also setBit() and clearBit().
Upstream PySide2 reference signatures (binding differences may apply):
toggleBit(self, i: int) -> bool
Source: https://doc.qt.io/archives/qt-5.15/qbitarray.html#toggleBit
truncate
truncate(pos: int) -> None
X.truncate(pos)
Supplemental documentation: Qt 5 reference:
void QBitArray::truncate(int pos)
Truncates the bit array at index position pos.
If pos is beyond the end of the array, nothing happens.
See also resize().
Upstream PySide2 reference signatures (binding differences may apply):
truncate(self, pos: int) -> None
Source: https://doc.qt.io/archives/qt-5.15/qbitarray.html#truncate
writeTo
writeTo(arg__1: Any) -> Any
X.writeTo(arg__1)