diff options
Diffstat (limited to 'doc/qtl.doc')
-rw-r--r-- | doc/qtl.doc | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/doc/qtl.doc b/doc/qtl.doc index f2cdf744a..2c3ab4e34 100644 --- a/doc/qtl.doc +++ b/doc/qtl.doc @@ -68,7 +68,7 @@ use QPtrCollection and friends, all of which operate on pointers rather than values. This applies, for example, to all classes derived from \l TQObject. A TQObject does not have a copy constructor, so using it as value is impossible. You may choose to store pointers to -TQObjects in a QValueList, but using QPtrList directly seems to be the +TQObjects in a TQValueList, but using QPtrList directly seems to be the better choice for this kind of application domain. QPtrList, like all other QPtrCollection based containers, provides far more sanity checking than a speed-optimized value based container. @@ -109,7 +109,7 @@ iterator matches the size of a normal pointer. To iterate over a container, use a loop like this: \code - typedef QValueList<int> List; + typedef TQValueList<int> List; List list; for( List::Iterator it = list.begin(); it != list.end(); ++it ) printf( "Number is %i\n", *it ); @@ -125,12 +125,12 @@ operator (it++, it--), since the former is slightly faster. The same concept applies to the other container classes: \code - typedef QMap<TQString,TQString> Map; + typedef TQMap<TQString,TQString> Map; Map map; for( Map::iterator it = map.begin(); it != map.end(); ++it ) printf( "Key=%s Data=%s\n", it.key().ascii(), it.data().ascii() ); - typedef QValueVector<int> Vector; + typedef TQValueVector<int> Vector; Vector vec; for( Vector::iterator it = vec.begin(); it != vec.end(); ++it ) printf( "Data=%d\n", *it ); @@ -156,7 +156,7 @@ that provides iterators (including your own containers). qHeapSort() provides a well known sorting algorithm. You can use it like this: \code - typedef QValueList<int> List; + typedef TQValueList<int> List; List list; list << 42 << 100 << 1234 << 12 << 8; qHeapSort( list ); @@ -197,7 +197,7 @@ tqSwap() exchanges the values of two variables: The tqCount() template function counts the number of occurrences of a value within a container. For example: \code - QValueList<int> list; + TQValueList<int> list; list.push_back( 1 ); list.push_back( 1 ); list.push_back( 1 ); @@ -212,12 +212,12 @@ value within a container. For example: The tqFind() template function finds the first occurrence of a value within a container. For example: \code - QValueList<int> list; + TQValueList<int> list; list.push_back( 1 ); list.push_back( 1 ); list.push_back( 1 ); list.push_back( 2 ); - QValueListIterator<int> it = tqFind( list.begin(), list.end(), 2 ); + TQValueListIterator<int> it = tqFind( list.begin(), list.end(), 2 ); \endcode \target tqFill @@ -226,7 +226,7 @@ within a container. For example: The tqFill() template function fills a range with copies of a value. For example: \code - QValueVector<int> vec(3); + TQValueVector<int> vec(3); tqFill( vec.begin(), vec.end(), 99 ); // vec contains 99, 99, 99 \endcode @@ -239,12 +239,12 @@ considered, only if the elements in the first range are equal to the corresponding elements in the second range (consequently, both ranges must be valid). For example: \code - QValueVector<int> v1(3); + TQValueVector<int> v1(3); v1[0] = 1; v1[2] = 2; v1[3] = 3; - QValueVector<int> v2(5); + TQValueVector<int> v2(5); v2[0] = 1; v2[2] = 2; v2[3] = 3; @@ -261,7 +261,7 @@ must be valid). For example: The tqCopy() template function copies a range of elements to an OutputIterator, in this case a QTextOStreamIterator: \code - QValueList<int> list; + TQValueList<int> list; list.push_back( 100 ); list.push_back( 200 ); list.push_back( 300 ); @@ -276,11 +276,11 @@ which creates a QBackInsertIterator<> whose job is to insert elements into the end of a container. For example: \code - QValueList<int> l; + TQValueList<int> l; l.push_back( 100 ); l.push_back( 200 ); l.push_back( 300 ); - QValueVector<int> v; + TQValueVector<int> v; tqCopy( l.begin(), l.end(), qBackInserter(v) ); \endcode \endomit @@ -291,11 +291,11 @@ into the end of a container. For example: The tqCopyBackward() template function copies a container or a slice of a container to an OutputIterator, but in reverse order, for example: \code - QValueVector<int> vec(3); + TQValueVector<int> vec(3); vec.push_back( 100 ); vec.push_back( 200 ); vec.push_back( 300 ); - QValueVector<int> another; + TQValueVector<int> another; tqCopyBackward( vec.begin(), vec.end(), another.begin() ); // 'another' now contains 100, 200, 300 // however the elements are copied one at a time @@ -315,7 +315,7 @@ illustrates this: list2 << "Torben" << "Matthias"; tqCopy( list2.begin(), list2.end(), list1.begin() ); - QValueVector<TQString> vec( list1.size(), "Dave" ); + TQValueVector<TQString> vec( list1.size(), "Dave" ); tqCopy( list2.begin(), list2.end(), vec.begin() ); \endcode @@ -342,7 +342,7 @@ appropriate streaming operators. Here is an example. \code QDataStream str(...); - QValueList<QRect> list; + TQValueList<QRect> list; // ... fill the list here str << list; \endcode @@ -350,11 +350,11 @@ appropriate streaming operators. Here is an example. The container can be read in again with: \code - QValueList<QRect> list; + TQValueList<QRect> list; str >> list; \endcode -The same applies to QStringList, QValueStack and QMap. +The same applies to QStringList, TQValueStack and TQMap. */ /*! |