Struct qt_gui::list::ListTouchDevicePtr
source · #[repr(C)]pub struct ListTouchDevicePtr(_);
Expand description
C++ type: QList<const QTouchDevice*>
The QList class is a template class that provides lists.
QList<T> is one of Qt's generic container classes. It stores items in a list that provides fast index-based access and index-based insertions and removals.
QList<T>, QLinkedList<T>, and QVector<T> provide similar APIs and functionality. They are often interchangeable, but there are performance consequences. Here is an overview of use cases:
- QVector should be your default first choice. QVector<T> will usually give better performance than QList<T>, because QVector<T> always stores its items sequentially in memory, where QList<T> will allocate its items on the heap unless
sizeof(T) <= sizeof(void*)
and T has been declared to be either aQ_MOVABLE_TYPE
or aQ_PRIMITIVE_TYPE
using Q_DECLARE_TYPEINFO. See the Pros and Cons of Using QList for an explanation. - However, QList is used throughout the Qt APIs for passing parameters and for returning values. Use QList to interface with those APIs.
- If you need a real linked list, which guarantees constant time insertions mid-list and uses iterators to items rather than indexes, use QLinkedList.
Note: QVector and QVarLengthArray both guarantee C-compatible array layout. QList does not. This might be important if your application must interface with a C API.
Note: Iterators into a QLinkedList and references into heap-allocating QLists remain valid as long as the referenced items remain in the container. This is not true for iterators and references into a QVector and non-heap-allocating QLists.
Internally, QList<T> is represented as an array of T if sizeof(T) <= sizeof(void*)
and T has been declared to be either a Q_MOVABLE_TYPE
or a Q_PRIMITIVE_TYPE
using Q_DECLARE_TYPEINFO. Otherwise, QList<T> is represented as an array of T* and the items are allocated on the heap.
The array representation allows very fast insertions and index-based access. The prepend() and append() operations are also very fast because QList preallocates memory at both ends of its internal array. (See Algorithmic Complexity for details.
Note, however, that when the conditions specified above are not met, each append or insert of a new item requires allocating the new item on the heap, and this per item allocation will make QVector a better choice for use cases that do a lot of appending or inserting, because QVector can allocate memory for many items in a single heap allocation.
Note that the internal array only ever gets bigger over the life of the list. It never shrinks. The internal array is deallocated by the destructor and by the assignment operator, when one list is assigned to another.
Here's an example of a QList that stores integers and a QList that stores QDate values:
QList<int> integerList; QList<QDate> dateList;
Qt includes a QStringList class that inherits QList<QString> and adds a few convenience functions, such as QStringList::join() and QStringList::filter(). QString::split() creates QStringLists from strings.
QList stores a list of items. The default constructor creates an empty list. To insert items into the list, you can use operator<<():
QList<QString> list; list << "one" << "two" << "three"; // list: ["one", "two", "three"]
QList provides these basic functions to add, move, and remove items: insert(), replace(), removeAt(), move(), and swap(). In addition, it provides the following convenience functions: append(), prepend(), removeFirst(), and removeLast().
QList uses 0-based indexes, just like C++ arrays. To access the item at a particular index position, you can use operator[](). On non-const lists, operator[]() returns a reference to the item and can be used on the left side of an assignment:
if (list[0] == "Bob") list[0] = "Robert";
Because QList is implemented as an array of pointers for types that are larger than a pointer or are not movable, this operation requires (constant time). For read-only access, an alternative syntax is to use at():
for (int i = 0; i < list.size(); ++i) { if (list.at(i) == "Jane") cout << "Found Jane at position " << i << endl; }
at() can be faster than operator[](), because it never causes a deep copy to occur.
A common requirement is to remove an item from a list and do something with it. For this, QList provides takeAt(), takeFirst(), and takeLast(). Here's a loop that removes the items from a list one at a time and calls delete
on them:
QList<QWidget *> list; ... while (!list.isEmpty()) delete list.takeFirst();
Inserting and removing items at either end of the list is very fast (constant time in most cases), because QList preallocates extra space on both sides of its internal buffer to allow for fast growth at both ends of the list.
If you want to find all occurrences of a particular value in a list, use indexOf() or lastIndexOf(). The former searches forward starting from a given index position, the latter searches backward. Both return the index of a matching item if they find it; otherwise, they return -1. For example:
int i = list.indexOf("Jane"); if (i != -1) cout << "First occurrence of Jane is at position " << i << endl;
If you simply want to check whether a list contains a particular value, use contains(). If you want to find out how many times a particular value occurs in the list, use count(). If you want to replace all occurrences of a particular value with another, use replace().
QList's value type must be an assignable data type. This covers most data types that are commonly used, but the compiler won't let you, for example, store a QWidget as a value; instead, store a QWidget *. A few functions have additional requirements; for example, indexOf() and lastIndexOf() expect the value type to support operator==()
. These requirements are documented on a per-function basis.
Like the other container classes, QList provides Java-style iterators (QListIterator and QMutableListIterator) and STL-style iterators (QList::const_iterator and QList::iterator). In practice, these are rarely used, because you can use indexes into the QList. QList is implemented in such a way that direct index-based access is just as fast as using iterators.
QList does not support inserting, prepending, appending or replacing with references to its own values. Doing so will cause your application to abort with an error message.
To make QList as efficient as possible, its member functions don't validate their input before using it. Except for isEmpty(), member functions always assume the list is not empty. Member functions that take index values as parameters always assume their index value parameters are in the valid range. This means QList member functions can fail. If you define QT_NO_DEBUG when you compile, failures will not be detected. If you don't define QT_NO_DEBUG, failures will be detected using Q_ASSERT() or Q_ASSERT_X() with an appropriate message.
To avoid failures when your list can be empty, call isEmpty() before calling other member functions. If you must pass an index value that might not be in the valid range, check that it is less than the value returned by size() but not less than 0.
Implementations§
source§impl ListTouchDevicePtr
impl ListTouchDevicePtr
sourcepub fn append(&mut self, t: &ListTouchDevicePtr)
pub fn append(&mut self, t: &ListTouchDevicePtr)
C++ method: void QList<const QTouchDevice*>::append(const QList<const QTouchDevice*>& t)
This is an overloaded function.
Appends the items of the value list to this list.
This function was introduced in Qt 4.5.
See also operator<<() and operator+=().
sourcepub unsafe fn append_unsafe(&mut self, t: &*const TouchDevice)
pub unsafe fn append_unsafe(&mut self, t: &*const TouchDevice)
C++ method: void QList<const QTouchDevice*>::append(const QTouchDevice* const & t)
Inserts value at the end of the list.
Example:
QList<QString> list; list.append("one"); list.append("two"); list.append("three"); // list: ["one", "two", "three"]
This is the same as list.insert(size(), value).
If this list is not shared, this operation is typically very fast (amortized constant time), because QList preallocates extra space on both sides of its internal buffer to allow for fast growth at both ends of the list.
See also operator<<(), prepend(), and insert().
sourcepub fn at<'l0>(&'l0 self, i: c_int) -> &'l0 *const TouchDevice
pub fn at<'l0>(&'l0 self, i: c_int) -> &'l0 *const TouchDevice
C++ method: const QTouchDevice* const & QList<const QTouchDevice*>::at(int i) const
Returns the item at index position i in the list. i must be a valid index position in the list (i.e., 0 <= i < size()).
This function is very fast (constant time).
See also value() and operator[]().
sourcepub fn back<'l0>(&'l0 self) -> &'l0 *const TouchDevice
pub fn back<'l0>(&'l0 self) -> &'l0 *const TouchDevice
C++ method: const QTouchDevice* const & QList<const QTouchDevice*>::back() const
This is an overloaded function.
sourcepub fn back_mut<'l0>(&'l0 mut self) -> &'l0 mut *const TouchDevice
pub fn back_mut<'l0>(&'l0 mut self) -> &'l0 mut *const TouchDevice
C++ method: const QTouchDevice*& QList<const QTouchDevice*>::back()
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
C++ method: void QList<const QTouchDevice*>::clear()
Removes all items from the list.
See also removeAll().
sourcepub fn const_first<'l0>(&'l0 self) -> &'l0 *const TouchDevice
pub fn const_first<'l0>(&'l0 self) -> &'l0 *const TouchDevice
C++ method: const QTouchDevice* const & QList<const QTouchDevice*>::constFirst() const
sourcepub fn const_last<'l0>(&'l0 self) -> &'l0 *const TouchDevice
pub fn const_last<'l0>(&'l0 self) -> &'l0 *const TouchDevice
C++ method: const QTouchDevice* const & QList<const QTouchDevice*>::constLast() const
Returns a reference to the last item in the list. The list must not be empty. If the list can be empty, call isEmpty() before calling this function.
This function was introduced in Qt 5.6.
See also constFirst(), isEmpty(), and last().
sourcepub unsafe fn contains(&self, t: &*const TouchDevice) -> bool
pub unsafe fn contains(&self, t: &*const TouchDevice) -> bool
C++ method: bool QList<const QTouchDevice*>::contains(const QTouchDevice* const & t) const
sourcepub fn count(&self) -> c_int
pub fn count(&self) -> c_int
C++ method: int QList<const QTouchDevice*>::count() const
Returns the number of items in the list. This is effectively the same as size().
sourcepub unsafe fn count_unsafe(&self, t: &*const TouchDevice) -> c_int
pub unsafe fn count_unsafe(&self, t: &*const TouchDevice) -> c_int
C++ method: int QList<const QTouchDevice*>::count(const QTouchDevice* const & t) const
sourcepub fn empty(&self) -> bool
pub fn empty(&self) -> bool
C++ method: bool QList<const QTouchDevice*>::empty() const
This function is provided for STL compatibility. It is equivalent to isEmpty() and returns true
if the list is empty.
sourcepub unsafe fn ends_with(&self, t: &*const TouchDevice) -> bool
pub unsafe fn ends_with(&self, t: &*const TouchDevice) -> bool
C++ method: bool QList<const QTouchDevice*>::endsWith(const QTouchDevice* const & t) const
sourcepub fn first<'l0>(&'l0 self) -> &'l0 *const TouchDevice
pub fn first<'l0>(&'l0 self) -> &'l0 *const TouchDevice
C++ method: const QTouchDevice* const & QList<const QTouchDevice*>::first() const
This is an overloaded function.
sourcepub fn first_mut<'l0>(&'l0 mut self) -> &'l0 mut *const TouchDevice
pub fn first_mut<'l0>(&'l0 mut self) -> &'l0 mut *const TouchDevice
C++ method: const QTouchDevice*& QList<const QTouchDevice*>::first()
Returns a reference to the first item in the list. The list must not be empty. If the list can be empty, call isEmpty() before calling this function.
See also constFirst(), last(), and isEmpty().
sourcepub fn front<'l0>(&'l0 self) -> &'l0 *const TouchDevice
pub fn front<'l0>(&'l0 self) -> &'l0 *const TouchDevice
C++ method: const QTouchDevice* const & QList<const QTouchDevice*>::front() const
This is an overloaded function.
sourcepub fn front_mut<'l0>(&'l0 mut self) -> &'l0 mut *const TouchDevice
pub fn front_mut<'l0>(&'l0 mut self) -> &'l0 mut *const TouchDevice
C++ method: const QTouchDevice*& QList<const QTouchDevice*>::front()
sourcepub unsafe fn index_of<'largs, Args>(&'largs self, args: Args) -> c_intwhere
Args: ListTouchDevicePtrIndexOfArgs<'largs>,
pub unsafe fn index_of<'largs, Args>(&'largs self, args: Args) -> c_intwhere
Args: ListTouchDevicePtrIndexOfArgs<'largs>,
C++ method: QList<const QTouchDevice*>::indexOf
This is an overloaded function. Available variants:
Variant 1
Rust arguments: fn index_of(&self, &*const ::touch_device::TouchDevice) -> ::libc::c_int
C++ method: int QList<const QTouchDevice*>::indexOf(const QTouchDevice* const & t) const
Returns the index position of the first occurrence of value in the list, searching forward from index position from. Returns -1 if no item matched.
Example:
QList<QString> list; list << "A" << "B" << "C" << "B" << "A"; list.indexOf("B"); // returns 1 list.indexOf("B", 1); // returns 1 list.indexOf("B", 2); // returns 3 list.indexOf("X"); // returns -1
This function requires the value type to have an implementation of operator==()
.
Note that QList uses 0-based indexes, just like C++ arrays. Negative indexes are not supported with the exception of the value mentioned above.
See also lastIndexOf() and contains().
Variant 2
Rust arguments: fn index_of(&self, (&*const ::touch_device::TouchDevice, ::libc::c_int)) -> ::libc::c_int
C++ method: int QList<const QTouchDevice*>::indexOf(const QTouchDevice* const & t, int from = ?) const
Returns the index position of the first occurrence of value in the list, searching forward from index position from. Returns -1 if no item matched.
Example:
QList<QString> list; list << "A" << "B" << "C" << "B" << "A"; list.indexOf("B"); // returns 1 list.indexOf("B", 1); // returns 1 list.indexOf("B", 2); // returns 3 list.indexOf("X"); // returns -1
This function requires the value type to have an implementation of operator==()
.
Note that QList uses 0-based indexes, just like C++ arrays. Negative indexes are not supported with the exception of the value mentioned above.
See also lastIndexOf() and contains().
sourcepub unsafe fn insert(&mut self, i: c_int, t: &*const TouchDevice)
pub unsafe fn insert(&mut self, i: c_int, t: &*const TouchDevice)
C++ method: void QList<const QTouchDevice*>::insert(int i, const QTouchDevice* const & t)
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
C++ method: bool QList<const QTouchDevice*>::isEmpty() const
Returns true
if the list contains no items; otherwise returns false.
See also size().
sourcepub fn last<'l0>(&'l0 self) -> &'l0 *const TouchDevice
pub fn last<'l0>(&'l0 self) -> &'l0 *const TouchDevice
C++ method: const QTouchDevice* const & QList<const QTouchDevice*>::last() const
This is an overloaded function.
sourcepub unsafe fn last_index_of<'largs, Args>(&'largs self, args: Args) -> c_intwhere
Args: ListTouchDevicePtrLastIndexOfArgs<'largs>,
pub unsafe fn last_index_of<'largs, Args>(&'largs self, args: Args) -> c_intwhere
Args: ListTouchDevicePtrLastIndexOfArgs<'largs>,
C++ method: QList<const QTouchDevice*>::lastIndexOf
This is an overloaded function. Available variants:
Variant 1
Rust arguments: fn last_index_of(&self, &*const ::touch_device::TouchDevice) -> ::libc::c_int
C++ method: int QList<const QTouchDevice*>::lastIndexOf(const QTouchDevice* const & t) const
Returns the index position of the last occurrence of value in the list, searching backward from index position from. If from is -1 (the default), the search starts at the last item. Returns -1 if no item matched.
Example:
QList<QString> list; list << "A" << "B" << "C" << "B" << "A"; list.lastIndexOf("B"); // returns 3 list.lastIndexOf("B", 3); // returns 3 list.lastIndexOf("B", 2); // returns 1 list.lastIndexOf("X"); // returns -1
This function requires the value type to have an implementation of operator==()
.
Note that QList uses 0-based indexes, just like C++ arrays. Negative indexes are not supported with the exception of the value mentioned above.
See also indexOf().
Variant 2
Rust arguments: fn last_index_of(&self, (&*const ::touch_device::TouchDevice, ::libc::c_int)) -> ::libc::c_int
C++ method: int QList<const QTouchDevice*>::lastIndexOf(const QTouchDevice* const & t, int from = ?) const
Returns the index position of the last occurrence of value in the list, searching backward from index position from. If from is -1 (the default), the search starts at the last item. Returns -1 if no item matched.
Example:
QList<QString> list; list << "A" << "B" << "C" << "B" << "A"; list.lastIndexOf("B"); // returns 3 list.lastIndexOf("B", 3); // returns 3 list.lastIndexOf("B", 2); // returns 1 list.lastIndexOf("X"); // returns -1
This function requires the value type to have an implementation of operator==()
.
Note that QList uses 0-based indexes, just like C++ arrays. Negative indexes are not supported with the exception of the value mentioned above.
See also indexOf().
sourcepub fn last_mut<'l0>(&'l0 mut self) -> &'l0 mut *const TouchDevice
pub fn last_mut<'l0>(&'l0 mut self) -> &'l0 mut *const TouchDevice
C++ method: const QTouchDevice*& QList<const QTouchDevice*>::last()
sourcepub fn mid<'largs, Args>(&'largs self, args: Args) -> ListTouchDevicePtrwhere
Args: ListTouchDevicePtrMidArgs<'largs>,
pub fn mid<'largs, Args>(&'largs self, args: Args) -> ListTouchDevicePtrwhere
Args: ListTouchDevicePtrMidArgs<'largs>,
C++ method: QList<const QTouchDevice*>::mid
This is an overloaded function. Available variants:
Variant 1
Rust arguments: fn mid(&self, ::libc::c_int) -> ::list::ListTouchDevicePtr
C++ method: QList<const QTouchDevice*> QList<const QTouchDevice*>::mid(int pos) const
Returns a sub-list which includes elements from this list, starting at position pos. If length is -1 (the default), all elements from pos are included; otherwise length elements (or all remaining elements if there are less than length elements) are included.
Variant 2
Rust arguments: fn mid(&self, (::libc::c_int, ::libc::c_int)) -> ::list::ListTouchDevicePtr
C++ method: QList<const QTouchDevice*> QList<const QTouchDevice*>::mid(int pos, int length = ?) const
Returns a sub-list which includes elements from this list, starting at position pos. If length is -1 (the default), all elements from pos are included; otherwise length elements (or all remaining elements if there are less than length elements) are included.
sourcepub fn move_(&mut self, from: c_int, to: c_int)
pub fn move_(&mut self, from: c_int, to: c_int)
C++ method: void QList<const QTouchDevice*>::move(int from, int to)
Moves the item at index position from to index position to.
Example:
QList<QString> list; list << "A" << "B" << "C" << "D" << "E" << "F"; list.move(1, 4); // list: ["A", "C", "D", "E", "B", "F"]
This is the same as insert(to, takeAt(from)).This function assumes that both from and to are at least 0 but less than size(). To avoid failure, test that both from and to are at least 0 and less than size().
sourcepub fn new<Args>(args: Args) -> ListTouchDevicePtrwhere
Args: ListTouchDevicePtrNewArgs,
pub fn new<Args>(args: Args) -> ListTouchDevicePtrwhere
Args: ListTouchDevicePtrNewArgs,
C++ method: QList<const QTouchDevice*>::QList
This is an overloaded function. Available variants:
Variant 1
Rust arguments: fn new(()) -> ::list::ListTouchDevicePtr
C++ method: [constructor] void QList<const QTouchDevice*>::QList()
Constructs an empty list.
Variant 2
Rust arguments: fn new(&::list::ListTouchDevicePtr) -> ::list::ListTouchDevicePtr
C++ method: [constructor] void QList<const QTouchDevice*>::QList(const QList<const QTouchDevice*>& l)
Constructs a copy of other.
This operation takes constant time, because QList is implicitly shared. This makes returning a QList from a function very fast. If a shared instance is modified, it will be copied (copy-on-write), and that takes linear time.
See also operator=().
sourcepub fn op_add(&self, l: &ListTouchDevicePtr) -> ListTouchDevicePtr
pub fn op_add(&self, l: &ListTouchDevicePtr) -> ListTouchDevicePtr
C++ method: QList<const QTouchDevice*> QList<const QTouchDevice*>::operator+(const QList<const QTouchDevice*>& l) const
Returns a list that contains all the items in this list followed by all the items in the other list.
See also operator+=().
sourcepub fn op_add_assign<'l0, 'l1>(
&'l0 mut self,
l: &'l1 ListTouchDevicePtr
) -> &'l0 mut ListTouchDevicePtr
pub fn op_add_assign<'l0, 'l1>(
&'l0 mut self,
l: &'l1 ListTouchDevicePtr
) -> &'l0 mut ListTouchDevicePtr
C++ method: QList<const QTouchDevice*>& QList<const QTouchDevice*>::operator+=(const QList<const QTouchDevice*>& l)
sourcepub unsafe fn op_add_assign_unsafe<'l0, 'l1>(
&'l0 mut self,
t: &'l1 *const TouchDevice
) -> &'l0 mut ListTouchDevicePtr
pub unsafe fn op_add_assign_unsafe<'l0, 'l1>(
&'l0 mut self,
t: &'l1 *const TouchDevice
) -> &'l0 mut ListTouchDevicePtr
C++ method: QList<const QTouchDevice*>& QList<const QTouchDevice*>::operator+=(const QTouchDevice* const & t)
sourcepub fn op_assign<'l0, 'l1>(
&'l0 mut self,
l: &'l1 ListTouchDevicePtr
) -> &'l0 mut ListTouchDevicePtr
pub fn op_assign<'l0, 'l1>(
&'l0 mut self,
l: &'l1 ListTouchDevicePtr
) -> &'l0 mut ListTouchDevicePtr
C++ method: QList<const QTouchDevice*>& QList<const QTouchDevice*>::operator=(const QList<const QTouchDevice*>& l)
Assigns other to this list and returns a reference to this list.
sourcepub fn op_eq(&self, l: &ListTouchDevicePtr) -> bool
pub fn op_eq(&self, l: &ListTouchDevicePtr) -> bool
C++ method: bool QList<const QTouchDevice*>::operator==(const QList<const QTouchDevice*>& l) const
Returns true
if other is equal to this list; otherwise returns false.
Two lists are considered equal if they contain the same values in the same order.
This function requires the value type to have an implementation of operator==()
.
See also operator!=().
sourcepub fn op_index<'l0>(&'l0 self, i: c_int) -> &'l0 *const TouchDevice
pub fn op_index<'l0>(&'l0 self, i: c_int) -> &'l0 *const TouchDevice
C++ method: const QTouchDevice* const & QList<const QTouchDevice*>::operator[](int i) const
This is an overloaded function.
Same as at(). This function runs in constant time.
sourcepub fn op_index_mut<'l0>(&'l0 mut self, i: c_int) -> &'l0 mut *const TouchDevice
pub fn op_index_mut<'l0>(&'l0 mut self, i: c_int) -> &'l0 mut *const TouchDevice
C++ method: const QTouchDevice*& QList<const QTouchDevice*>::operator[](int i)
Returns the item at index position i as a modifiable reference. i must be a valid index position in the list (i.e., 0 <= i < size()).
If this function is called on a list that is currently being shared, it will trigger a copy of all elements. Otherwise, this function runs in constant time. If you do not want to modify the list you should use QList::at().
sourcepub fn op_neq(&self, l: &ListTouchDevicePtr) -> bool
pub fn op_neq(&self, l: &ListTouchDevicePtr) -> bool
C++ method: bool QList<const QTouchDevice*>::operator!=(const QList<const QTouchDevice*>& l) const
Returns true
if other is not equal to this list; otherwise returns false
.
Two lists are considered equal if they contain the same values in the same order.
This function requires the value type to have an implementation of operator==()
.
See also operator==().
sourcepub fn op_shl<'l0, 'l1>(
&'l0 mut self,
l: &'l1 ListTouchDevicePtr
) -> &'l0 mut ListTouchDevicePtr
pub fn op_shl<'l0, 'l1>(
&'l0 mut self,
l: &'l1 ListTouchDevicePtr
) -> &'l0 mut ListTouchDevicePtr
C++ method: QList<const QTouchDevice*>& QList<const QTouchDevice*>::operator<<(const QList<const QTouchDevice*>& l)
Appends the items of the other list to this list and returns a reference to this list.
See also operator+=() and append().
sourcepub unsafe fn op_shl_unsafe<'l0, 'l1>(
&'l0 mut self,
t: &'l1 *const TouchDevice
) -> &'l0 mut ListTouchDevicePtr
pub unsafe fn op_shl_unsafe<'l0, 'l1>(
&'l0 mut self,
t: &'l1 *const TouchDevice
) -> &'l0 mut ListTouchDevicePtr
C++ method: QList<const QTouchDevice*>& QList<const QTouchDevice*>::operator<<(const QTouchDevice* const & t)
This is an overloaded function.
Appends value to the list.
sourcepub fn pop_back(&mut self)
pub fn pop_back(&mut self)
C++ method: void QList<const QTouchDevice*>::pop_back()
This function is provided for STL compatibility. It is equivalent to removeLast(). The list must not be empty. If the list can be empty, call isEmpty() before calling this function.
sourcepub fn pop_front(&mut self)
pub fn pop_front(&mut self)
C++ method: void QList<const QTouchDevice*>::pop_front()
This function is provided for STL compatibility. It is equivalent to removeFirst(). The list must not be empty. If the list can be empty, call isEmpty() before calling this function.
sourcepub unsafe fn prepend(&mut self, t: &*const TouchDevice)
pub unsafe fn prepend(&mut self, t: &*const TouchDevice)
C++ method: void QList<const QTouchDevice*>::prepend(const QTouchDevice* const & t)
Inserts value at the beginning of the list.
Example:
QList<QString> list; list.prepend("one"); list.prepend("two"); list.prepend("three"); // list: ["three", "two", "one"]
This is the same as list.insert(0, value).
If this list is not shared, this operation is typically very fast (amortized constant time), because QList preallocates extra space on both sides of its internal buffer to allow for fast growth at both ends of the list.
sourcepub unsafe fn push_back(&mut self, t: &*const TouchDevice)
pub unsafe fn push_back(&mut self, t: &*const TouchDevice)
C++ method: void QList<const QTouchDevice*>::push_back(const QTouchDevice* const & t)
This function is provided for STL compatibility. It is equivalent to append(value).
sourcepub unsafe fn push_front(&mut self, t: &*const TouchDevice)
pub unsafe fn push_front(&mut self, t: &*const TouchDevice)
C++ method: void QList<const QTouchDevice*>::push_front(const QTouchDevice* const & t)
This function is provided for STL compatibility. It is equivalent to prepend(value).
sourcepub unsafe fn remove_all(&mut self, t: &*const TouchDevice) -> c_int
pub unsafe fn remove_all(&mut self, t: &*const TouchDevice) -> c_int
C++ method: int QList<const QTouchDevice*>::removeAll(const QTouchDevice* const & t)
sourcepub fn remove_at(&mut self, i: c_int)
pub fn remove_at(&mut self, i: c_int)
C++ method: void QList<const QTouchDevice*>::removeAt(int i)
Removes the item at index position i. i must be a valid index position in the list (i.e., 0 <= i < size()).
See also takeAt(), removeFirst(), removeLast(), and removeOne().
sourcepub fn remove_first(&mut self)
pub fn remove_first(&mut self)
C++ method: void QList<const QTouchDevice*>::removeFirst()
sourcepub fn remove_last(&mut self)
pub fn remove_last(&mut self)
C++ method: void QList<const QTouchDevice*>::removeLast()
sourcepub unsafe fn remove_one(&mut self, t: &*const TouchDevice) -> bool
pub unsafe fn remove_one(&mut self, t: &*const TouchDevice) -> bool
C++ method: bool QList<const QTouchDevice*>::removeOne(const QTouchDevice* const & t)
Removes the first occurrence of value in the list and returns true on success; otherwise returns false
.
Example:
QList<QString> list; list << "sun" << "cloud" << "sun" << "rain"; list.removeOne("sun"); // list: ["cloud", ,"sun", "rain"]
This function requires the value type to have an implementation of operator==()
.
This function was introduced in Qt 4.4.
sourcepub unsafe fn replace(&mut self, i: c_int, t: &*const TouchDevice)
pub unsafe fn replace(&mut self, i: c_int, t: &*const TouchDevice)
C++ method: void QList<const QTouchDevice*>::replace(int i, const QTouchDevice* const & t)
Replaces the item at index position i with value. i must be a valid index position in the list (i.e., 0 <= i < size()).
See also operator[]() and removeAt().
sourcepub fn reserve(&mut self, size: c_int)
pub fn reserve(&mut self, size: c_int)
C++ method: void QList<const QTouchDevice*>::reserve(int size)
Reserve space for alloc elements.
If alloc is smaller than the current size of the list, nothing will happen.
Use this function to avoid repetetive reallocation of QList's internal data if you can predict how many elements will be appended. Note that the reservation applies only to the internal pointer array.
This function was introduced in Qt 4.7.
sourcepub unsafe fn starts_with(&self, t: &*const TouchDevice) -> bool
pub unsafe fn starts_with(&self, t: &*const TouchDevice) -> bool
C++ method: bool QList<const QTouchDevice*>::startsWith(const QTouchDevice* const & t) const
sourcepub fn swap<'largs, Args>(&'largs mut self, args: Args)where
Args: ListTouchDevicePtrSwapArgs<'largs>,
pub fn swap<'largs, Args>(&'largs mut self, args: Args)where
Args: ListTouchDevicePtrSwapArgs<'largs>,
C++ method: QList<const QTouchDevice*>::swap
This is an overloaded function. Available variants:
Variant 1
Rust arguments: fn swap(&mut self, &mut ::list::ListTouchDevicePtr) -> ()
C++ method: void QList<const QTouchDevice*>::swap(QList<const QTouchDevice*>& other)
Swaps list other with this list. This operation is very fast and never fails.
This function was introduced in Qt 4.8.
Variant 2
Rust arguments: fn swap(&mut self, (::libc::c_int, ::libc::c_int)) -> ()
C++ method: void QList<const QTouchDevice*>::swap(int i, int j)
Exchange the item at index position i with the item at index position j. This function assumes that both i and j are at least 0 but less than size(). To avoid failure, test that both i and j are at least 0 and less than size().
Example:
QList<QString> list; list << "A" << "B" << "C" << "D" << "E" << "F"; list.swap(1, 4); // list: ["A", "E", "C", "D", "B", "F"]
See also move().
sourcepub fn take_at(&mut self, i: c_int) -> *const TouchDevice
pub fn take_at(&mut self, i: c_int) -> *const TouchDevice
C++ method: const QTouchDevice* QList<const QTouchDevice*>::takeAt(int i)
sourcepub fn take_first(&mut self) -> *const TouchDevice
pub fn take_first(&mut self) -> *const TouchDevice
C++ method: const QTouchDevice* QList<const QTouchDevice*>::takeFirst()
Removes the first item in the list and returns it. This is the same as takeAt(0). This function assumes the list is not empty. To avoid failure, call isEmpty() before calling this function.
If this list is not shared, this operation takes constant time.
If you don't use the return value, removeFirst() is more efficient.
See also takeLast(), takeAt(), and removeFirst().
sourcepub fn take_last(&mut self) -> *const TouchDevice
pub fn take_last(&mut self) -> *const TouchDevice
C++ method: const QTouchDevice* QList<const QTouchDevice*>::takeLast()
Removes the last item in the list and returns it. This is the same as takeAt(size() - 1). This function assumes the list is not empty. To avoid failure, call isEmpty() before calling this function.
If this list is not shared, this operation takes constant time.
If you don't use the return value, removeLast() is more efficient.
See also takeFirst(), takeAt(), and removeLast().
sourcepub fn value(&self, i: c_int) -> *const TouchDevice
pub fn value(&self, i: c_int) -> *const TouchDevice
C++ method: const QTouchDevice* QList<const QTouchDevice*>::value(int i) const
Returns the value at index position i in the list.
If the index i is out of bounds, the function returns a default-constructed value. If you are certain that the index is going to be within bounds, you can use at() instead, which is slightly faster.
See also at() and operator[]().
sourcepub unsafe fn value_unsafe(
&self,
i: c_int,
default_value: &*const TouchDevice
) -> *const TouchDevice
pub unsafe fn value_unsafe(
&self,
i: c_int,
default_value: &*const TouchDevice
) -> *const TouchDevice
C++ method: const QTouchDevice* QList<const QTouchDevice*>::value(int i, const QTouchDevice* const & defaultValue) const
This is an overloaded function.
If the index i is out of bounds, the function returns defaultValue.