From 4d495175043c399fdca6e1bb4c74ef176fc76fb4 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Wed, 6 Aug 2025 11:29:57 +0900 Subject: Replace TRUE/FALSE with boolean values true/false - part 4 Signed-off-by: Michele Calgaro --- doc/html/tqptrlist.html | 50 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'doc/html/tqptrlist.html') diff --git a/doc/html/tqptrlist.html b/doc/html/tqptrlist.html index 905bab097..e8698eb9e 100644 --- a/doc/html/tqptrlist.html +++ b/doc/html/tqptrlist.html @@ -141,7 +141,7 @@ Example: }; TQPtrList<Employee> list; - list.setAutoDelete( TRUE ); // the list owns the objects + list.setAutoDelete( true ); // the list owns the objects list.append( new Employee("John", "Doe", 50000) ); list.append( new Employee("Jane", "Williams", 80000) ); @@ -175,7 +175,7 @@ Example: using a TQPtrListIterator can be more practical. Multiple list iterators may traverse the same list, independently of each other and of the current list item. -

In the example above we make the call setAutoDelete(TRUE). +

In the example above we make the call setAutoDelete(true). Enabling auto-deletion tells the list to delete items that are removed. The default is to not delete items when they are removed but this would cause a memory leak in the example because there @@ -259,7 +259,7 @@ item, last item, or current item, whichever is closest to index.

bool TQPtrCollection::autoDelete () const

-

Returns the setting of the auto-delete option. The default is FALSE. +

Returns the setting of the auto-delete option. The default is false.

See also setAutoDelete().

void TQPtrList::clear () [virtual] @@ -438,8 +438,8 @@ a few additional items.

Inserts the item at position index in the list. -

Returns TRUE if successful, i.e. if index is in range; -otherwise returns FALSE. The valid range is 0 to count() +

Returns true if successful, i.e. if index is in range; +otherwise returns false. The valid range is 0 to count() (inclusively). The item is appended if index == count().

The inserted item becomes the current list item.

item must not be 0. @@ -448,7 +448,7 @@ otherwise returns FALSE. The valid range is 0 to count()

bool TQPtrList::isEmpty () const

-

Returns TRUE if the list is empty; otherwise returns FALSE. +

Returns true if the list is empty; otherwise returns false.

See also count().

type * TQPtrList::last () @@ -472,8 +472,8 @@ function call was the last item, the current item will be set to

bool TQPtrList::operator!= ( const TQPtrList<type> & list ) const

-

Compares this list with list. Returns TRUE if the lists contain -different data; otherwise returns FALSE. +

Compares this list with list. Returns true if the lists contain +different data; otherwise returns false.

TQPtrList<type> & TQPtrList::operator= ( const TQPtrList<type> & list )

@@ -485,8 +485,8 @@ copied (shallow copy) unless newItem(

bool TQPtrList::operator== ( const TQPtrList<type> & list ) const

-

Compares this list with list. Returns TRUE if the lists contain -the same data; otherwise returns FALSE. +

Compares this list with list. Returns true if the lists contain +the same data; otherwise returns false.

void TQPtrList::prepend ( const type * item )

@@ -519,8 +519,8 @@ the stream.

Removes the item at position index in the list. -

Returns TRUE if successful, i.e. if index is in range; -otherwise returns FALSE. The valid range is 0..(count() - 1) +

Returns true if successful, i.e. if index is in range; +otherwise returns false. The valid range is 0..(count() - 1) inclusive.

The removed item is deleted if auto-deletion is enabled.

The item after the removed item becomes the new current list item @@ -535,8 +535,8 @@ point to the new current item.

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Removes the current list item. -

Returns TRUE if successful, i.e. if the current item isn't 0; -otherwise returns FALSE. +

Returns true if successful, i.e. if the current item isn't 0; +otherwise returns false.

The removed item is deleted if auto-deletion is enabled.

The item after the removed item becomes the new current list item if the removed item is not the last item in the list. If the last @@ -551,8 +551,8 @@ point to the new current item.

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Removes the first occurrence of item from the list. -

Returns TRUE if successful, i.e. if item is in the list; -otherwise returns FALSE. +

Returns true if successful, i.e. if item is in the list; +otherwise returns false.

The removed item is deleted if auto-deletion is enabled.

The compareItems() function is called when searching for the item in the list. If compareItems() is not reimplemented, it is more @@ -569,8 +569,8 @@ point to the new current item.

bool TQPtrList::removeFirst ()

-

Removes the first item from the list. Returns TRUE if successful, -i.e. if the list isn't empty; otherwise returns FALSE. +

Removes the first item from the list. Returns true if successful, +i.e. if the list isn't empty; otherwise returns false.

The removed item is deleted if auto-deletion is enabled.

The first item in the list becomes the new current list item. The current item is set to 0 if the list becomes empty. @@ -581,8 +581,8 @@ point to the new current item.

bool TQPtrList::removeLast ()

-

Removes the last item from the list. Returns TRUE if successful, -i.e. if the list isn't empty; otherwise returns FALSE. +

Removes the last item from the list. Returns true if successful, +i.e. if the list isn't empty; otherwise returns false.

The removed item is deleted if auto-deletion is enabled.

The last item in the list becomes the new current list item. The current item is set to 0 if the list becomes empty. @@ -608,8 +608,8 @@ the removed item was the last item.

Removes the first occurrence of item from the list. -

Returns TRUE if successful, i.e. if item is in the list; -otherwise returns FALSE. +

Returns true if successful, i.e. if item is in the list; +otherwise returns false.

The removed item is deleted if auto-deletion is enabled.

Equivalent to:

@@ -629,7 +629,7 @@ point to the new current item.
 
 
 

Replaces the item at position index with the new item. -

Returns TRUE if successful, i.e. index is in the range 0 to +

Returns true if successful, i.e. index is in the range 0 to count()-1.

See also append(), current(), and insert(). @@ -637,11 +637,11 @@ point to the new current item.

Sets the collection to auto-delete its contents if enable is -TRUE and to never delete them if enable is FALSE. +true and to never delete them if enable is false.

If auto-deleting is turned on, all the items in a collection are deleted when the collection itself is deleted. This is convenient if the collection has the only pointer to the items. -

The default setting is FALSE, for safety. If you turn it on, be +

The default setting is false, for safety. If you turn it on, be careful about copying the collection - you might find yourself with two collections deleting the same items.

Note that the auto-delete setting may also affect other functions -- cgit v1.2.3