diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-02-13 17:43:39 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-02-13 17:43:39 -0600 |
commit | 359640943bcf155faa9a067dde9e00a123276290 (patch) | |
tree | fb3d55ea5e18949042fb0064123fb73d2b1eb932 /doc/qtl.doc | |
parent | a829bcdc533e154000803d517200d32fe762e85c (diff) | |
download | tqt3-359640943bcf155faa9a067dde9e00a123276290.tar.gz tqt3-359640943bcf155faa9a067dde9e00a123276290.zip |
Automated update from Qt3
Diffstat (limited to 'doc/qtl.doc')
-rw-r--r-- | doc/qtl.doc | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/doc/qtl.doc b/doc/qtl.doc index 591621543..42eee39c7 100644 --- a/doc/qtl.doc +++ b/doc/qtl.doc @@ -181,20 +181,20 @@ your data's class. Naturally, the sorting templates won't work with const iterators. -\target qSwap -\section2 qSwap() +\target tqSwap +\section2 tqSwap() -qSwap() exchanges the values of two variables: +tqSwap() exchanges the values of two variables: \code QString second( "Einstein" ); QString name( "Albert" ); - qSwap( second, name ); + tqSwap( second, name ); \endcode -\target qCount -\section2 qCount() +\target tqCount +\section2 tqCount() -The qCount() template function counts the number of occurrences of a +The tqCount() template function counts the number of occurrences of a value within a container. For example: \code QValueList<int> list; @@ -203,13 +203,13 @@ value within a container. For example: list.push_back( 1 ); list.push_back( 2 ); int c = 0; - qCount( list.begin(), list.end(), 1, c ); // c == 3 + tqCount( list.begin(), list.end(), 1, c ); // c == 3 \endcode -\target qFind -\section2 qFind() +\target tqFind +\section2 tqFind() -The qFind() template function finds the first occurrence of a value +The tqFind() template function finds the first occurrence of a value within a container. For example: \code QValueList<int> list; @@ -217,23 +217,23 @@ within a container. For example: list.push_back( 1 ); list.push_back( 1 ); list.push_back( 2 ); - QValueListIterator<int> it = qFind( list.begin(), list.end(), 2 ); + QValueListIterator<int> it = tqFind( list.begin(), list.end(), 2 ); \endcode -\target qFill -\section2 qFill() +\target tqFill +\section2 tqFill() -The qFill() template function fills a range with copies of a value. +The tqFill() template function fills a range with copies of a value. For example: \code QValueVector<int> vec(3); - qFill( vec.begin(), vec.end(), 99 ); // vec contains 99, 99, 99 + tqFill( vec.begin(), vec.end(), 99 ); // vec contains 99, 99, 99 \endcode -\target qEqual -\section2 qEqual() +\target tqEqual +\section2 tqEqual() -The qEqual() template function compares two ranges for equality of +The tqEqual() template function compares two ranges for equality of their elements. Note that the number of elements in each range is not considered, only if the elements in the first range are equal to the corresponding elements in the second range (consequently, both ranges @@ -251,14 +251,14 @@ must be valid). For example: v2[4] = 4; v2[5] = 5; - bool b = qEqual( v1.begin(), v2.end(), v2.begin() ); + bool b = tqEqual( v1.begin(), v2.end(), v2.begin() ); // b == TRUE \endcode -\target qCopy -\section2 qCopy() +\target tqCopy +\section2 tqCopy() -The qCopy() template function copies a range of elements to an +The tqCopy() template function copies a range of elements to an OutputIterator, in this case a QTextOStreamIterator: \code QValueList<int> list; @@ -266,7 +266,7 @@ OutputIterator, in this case a QTextOStreamIterator: list.push_back( 200 ); list.push_back( 300 ); QTextOStream str( stdout ); - qCopy( list.begin(), list.end(), QTextOStreamIterator(str) ); + tqCopy( list.begin(), list.end(), QTextOStreamIterator(str) ); \endcode \omit @@ -281,14 +281,14 @@ into the end of a container. For example: l.push_back( 200 ); l.push_back( 300 ); QValueVector<int> v; - qCopy( l.begin(), l.end(), qBackInserter(v) ); + tqCopy( l.begin(), l.end(), qBackInserter(v) ); \endcode \endomit -\target qCopyBackward -\section2 qCopyBackward() +\target tqCopyBackward +\section2 tqCopyBackward() -The qCopyBackward() template function copies a container or a slice of +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); @@ -296,7 +296,7 @@ a container to an OutputIterator, but in reverse order, for example: vec.push_back( 200 ); vec.push_back( 300 ); QValueVector<int> another; - qCopyBackward( vec.begin(), vec.end(), another.begin() ); + tqCopyBackward( vec.begin(), vec.end(), another.begin() ); // 'another' now contains 100, 200, 300 // however the elements are copied one at a time // in reverse order (300, 200, then 100) @@ -313,10 +313,10 @@ illustrates this: QStringList list1, list2; list1 << "Weis" << "Ettrich" << "Arnt" << "Sue"; list2 << "Torben" << "Matthias"; - qCopy( list2.begin(), list2.end(), list1.begin() ); + tqCopy( list2.begin(), list2.end(), list1.begin() ); QValueVector<QString> vec( list1.size(), "Dave" ); - qCopy( list2.begin(), list2.end(), vec.begin() ); + tqCopy( list2.begin(), list2.end(), vec.begin() ); \endcode At the end of this code fragment, the list list1 contains "Torben", @@ -327,12 +327,12 @@ overwritten. The vector vec contains "Torben", "Matthias", "Dave" and If you write new algorithms, consider writing them as template functions in order to make them usable with as many containers as possible. In the above example, you could just as easily print out -a standard C++ array with qCopy(): +a standard C++ array with tqCopy(): \code int arr[] = { 100, 200, 300 }; QTextOStream str( stdout ); - qCopy( arr, arr + 3, QTextOStreamIterator( str ) ); + tqCopy( arr, arr + 3, QTextOStreamIterator( str ) ); \endcode \section1 Streaming |