diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-26 23:32:43 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-26 23:32:43 -0600 |
commit | ea318d1431c89e647598c510c4245c6571aa5f46 (patch) | |
tree | 996d29b80c30d453dda86d1a23162d441628f169 /doc/html/qt-template-lib.html | |
parent | aaf89d4b48f69c9293feb187db26362e550b5561 (diff) | |
download | tqt3-ea318d1431c89e647598c510c4245c6571aa5f46.tar.gz tqt3-ea318d1431c89e647598c510c4245c6571aa5f46.zip |
Update to latest tqt3 automated conversion
Diffstat (limited to 'doc/html/qt-template-lib.html')
-rw-r--r-- | doc/html/qt-template-lib.html | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/doc/html/qt-template-lib.html b/doc/html/qt-template-lib.html index 68f443778..f76eb0496 100644 --- a/doc/html/qt-template-lib.html +++ b/doc/html/qt-template-lib.html @@ -51,11 +51,11 @@ of the STL container API. Compared with the STL, TQTL has no platform differences, but is often a little slower and often expands to less object code. <p> If you cannot make copies of the objects you want to store you should -use <a href="qptrcollection.html">TQPtrCollection</a> and friends, all of which operate on pointers +use <a href="ntqptrcollection.html">TQPtrCollection</a> and friends, all of which operate on pointers rather than values. This applies, for example, to all classes derived -from <a href="qobject.html">TQObject</a>. A <a href="qobject.html">TQObject</a> does not have a copy constructor, so using +from <a href="ntqobject.html">TQObject</a>. A <a href="ntqobject.html">TQObject</a> does not have a copy constructor, so using it as value is impossible. You may choose to store pointers to -TQObjects in a <a href="qvaluelist.html">TQValueList</a>, but using <a href="qptrlist.html">TQPtrList</a> directly seems to be the +TQObjects in a <a href="ntqvaluelist.html">TQValueList</a>, but using <a href="ntqptrlist.html">TQPtrList</a> directly seems to be the better choice for this kind of application domain. TQPtrList, like all other TQPtrCollection based containers, provides far more sanity checking than a speed-optimized value based container. @@ -70,13 +70,13 @@ instead. Value semantics require at least: <p> Note that a fast copy constructor is absolutely crucial to achieve good overall performance of the container, since many copy operations will occur. -<p> If you intend sorting your data you must implement <a href="qcstring.html#operator-lt-2">operator<</a>() for +<p> If you intend sorting your data you must implement <a href="ntqcstring.html#operator-lt-2">operator<</a>() for your data's class. -<p> Good candidates for value based classes are <a href="qrect.html">TQRect</a>, <a href="qpoint.html">TQPoint</a>, <a href="qsize.html">TQSize</a>, -<a href="qstring.html">TQString</a> and all simple C++ types, such as int, bool or double. +<p> Good candidates for value based classes are <a href="ntqrect.html">TQRect</a>, <a href="ntqpoint.html">TQPoint</a>, <a href="ntqsize.html">TQSize</a>, +<a href="ntqstring.html">TQString</a> and all simple C++ types, such as int, bool or double. <p> The TQt Template Library is designed for speed. Iterators are extremely fast. To achieve this performance, less error checking is done than in -the <a href="qptrcollection.html">TQPtrCollection</a> based containers. A TQTL container, for example, +the <a href="ntqptrcollection.html">TQPtrCollection</a> based containers. A TQTL container, for example, does not track any associated iterators. This makes certain validity checks, for example when removing items, impossible to perform automatically, but does lead to extremely good performance. @@ -152,7 +152,7 @@ like this: those elements that fall between the two iterators, i.e. 100, 1234 and 12. The third example shows that iterators act like pointers and can be treated as such. -<p> If using your own data types you must implement <a href="qcstring.html#operator-lt-2">operator<</a>() for +<p> If using your own data types you must implement <a href="ntqcstring.html#operator-lt-2">operator<</a>() for your data's class. <p> Naturally, the sorting templates won't work with const iterators. <p> <a name="qSwap"></a> @@ -160,8 +160,8 @@ your data's class. </h3> <a name="2-2"></a><p> qSwap() exchanges the values of two variables: <pre> - <a href="qstring.html">TQString</a> second( "Einstein" ); - <a href="qstring.html">TQString</a> name( "Albert" ); + <a href="ntqstring.html">TQString</a> second( "Einstein" ); + <a href="ntqstring.html">TQString</a> name( "Albert" ); qSwap( second, name ); </pre> @@ -171,13 +171,13 @@ your data's class. <a name="2-3"></a><p> The qCount() template function counts the number of occurrences of a value within a container. For example: <pre> - <a href="qvaluelist.html">TQValueList</a><int> list; - list.<a href="qvaluelist.html#push_back">push_back</a>( 1 ); - list.<a href="qvaluelist.html#push_back">push_back</a>( 1 ); - list.<a href="qvaluelist.html#push_back">push_back</a>( 1 ); - list.<a href="qvaluelist.html#push_back">push_back</a>( 2 ); + <a href="ntqvaluelist.html">TQValueList</a><int> list; + list.<a href="ntqvaluelist.html#push_back">push_back</a>( 1 ); + list.<a href="ntqvaluelist.html#push_back">push_back</a>( 1 ); + list.<a href="ntqvaluelist.html#push_back">push_back</a>( 1 ); + list.<a href="ntqvaluelist.html#push_back">push_back</a>( 2 ); int c = 0; - qCount( list.<a href="qvaluelist.html#begin">begin</a>(), list.<a href="qvaluelist.html#end">end</a>(), 1, c ); // c == 3 + qCount( list.<a href="ntqvaluelist.html#begin">begin</a>(), list.<a href="ntqvaluelist.html#end">end</a>(), 1, c ); // c == 3 </pre> <p> <a name="qFind"></a> @@ -186,12 +186,12 @@ value within a container. For example: <a name="2-4"></a><p> The qFind() template function finds the first occurrence of a value within a container. For example: <pre> - <a href="qvaluelist.html">TQValueList</a><int> list; - list.<a href="qvaluelist.html#push_back">push_back</a>( 1 ); - list.<a href="qvaluelist.html#push_back">push_back</a>( 1 ); - list.<a href="qvaluelist.html#push_back">push_back</a>( 1 ); - list.<a href="qvaluelist.html#push_back">push_back</a>( 2 ); - <a href="qvaluelistiterator.html">TQValueListIterator</a><int> it = qFind( list.<a href="qvaluelist.html#begin">begin</a>(), list.<a href="qvaluelist.html#end">end</a>(), 2 ); + <a href="ntqvaluelist.html">TQValueList</a><int> list; + list.<a href="ntqvaluelist.html#push_back">push_back</a>( 1 ); + list.<a href="ntqvaluelist.html#push_back">push_back</a>( 1 ); + list.<a href="ntqvaluelist.html#push_back">push_back</a>( 1 ); + list.<a href="ntqvaluelist.html#push_back">push_back</a>( 2 ); + <a href="qvaluelistiterator.html">TQValueListIterator</a><int> it = qFind( list.<a href="ntqvaluelist.html#begin">begin</a>(), list.<a href="ntqvaluelist.html#end">end</a>(), 2 ); </pre> <p> <a name="qFill"></a> @@ -200,8 +200,8 @@ within a container. For example: <a name="2-5"></a><p> The qFill() template function fills a range with copies of a value. For example: <pre> - <a href="qvaluevector.html">TQValueVector</a><int> vec(3); - qFill( vec.<a href="qvaluevector.html#begin">begin</a>(), vec.<a href="qvaluevector.html#end">end</a>(), 99 ); // vec contains 99, 99, 99 + <a href="ntqvaluevector.html">TQValueVector</a><int> vec(3); + qFill( vec.<a href="ntqvaluevector.html#begin">begin</a>(), vec.<a href="ntqvaluevector.html#end">end</a>(), 99 ); // vec contains 99, 99, 99 </pre> <p> <a name="qEqual"></a> @@ -213,19 +213,19 @@ 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: <pre> - <a href="qvaluevector.html">TQValueVector</a><int> v1(3); + <a href="ntqvaluevector.html">TQValueVector</a><int> v1(3); v1[0] = 1; v1[2] = 2; v1[3] = 3; - <a href="qvaluevector.html">TQValueVector</a><int> v2(5); + <a href="ntqvaluevector.html">TQValueVector</a><int> v2(5); v2[0] = 1; v2[2] = 2; v2[3] = 3; v2[4] = 4; v2[5] = 5; - bool b = qEqual( v1.<a href="qvaluevector.html#begin">begin</a>(), v2.<a href="qvaluevector.html#end">end</a>(), v2.<a href="qvaluevector.html#begin">begin</a>() ); + bool b = qEqual( v1.<a href="ntqvaluevector.html#begin">begin</a>(), v2.<a href="ntqvaluevector.html#end">end</a>(), v2.<a href="ntqvaluevector.html#begin">begin</a>() ); // b == TRUE </pre> @@ -235,12 +235,12 @@ must be valid). For example: <a name="2-7"></a><p> The qCopy() template function copies a range of elements to an OutputIterator, in this case a TQTextOStreamIterator: <pre> - <a href="qvaluelist.html">TQValueList</a><int> list; - list.<a href="qvaluelist.html#push_back">push_back</a>( 100 ); - list.<a href="qvaluelist.html#push_back">push_back</a>( 200 ); - list.<a href="qvaluelist.html#push_back">push_back</a>( 300 ); + <a href="ntqvaluelist.html">TQValueList</a><int> list; + list.<a href="ntqvaluelist.html#push_back">push_back</a>( 100 ); + list.<a href="ntqvaluelist.html#push_back">push_back</a>( 200 ); + list.<a href="ntqvaluelist.html#push_back">push_back</a>( 300 ); <a href="qtextostream.html">TQTextOStream</a> str( stdout ); - qCopy( list.<a href="qvaluelist.html#begin">begin</a>(), list.<a href="qvaluelist.html#end">end</a>(), TQTextOStreamIterator(str) ); + qCopy( list.<a href="ntqvaluelist.html#begin">begin</a>(), list.<a href="ntqvaluelist.html#end">end</a>(), TQTextOStreamIterator(str) ); </pre> <p> @@ -250,12 +250,12 @@ OutputIterator, in this case a TQTextOStreamIterator: <a name="2-8"></a><p> The qCopyBackward() template function copies a container or a slice of a container to an OutputIterator, but in reverse order, for example: <pre> - <a href="qvaluevector.html">TQValueVector</a><int> vec(3); - vec.<a href="qvaluevector.html#push_back">push_back</a>( 100 ); - vec.<a href="qvaluevector.html#push_back">push_back</a>( 200 ); - vec.<a href="qvaluevector.html#push_back">push_back</a>( 300 ); - <a href="qvaluevector.html">TQValueVector</a><int> another; - qCopyBackward( vec.<a href="qvaluevector.html#begin">begin</a>(), vec.<a href="qvaluevector.html#end">end</a>(), another.<a href="qvaluevector.html#begin">begin</a>() ); + <a href="ntqvaluevector.html">TQValueVector</a><int> vec(3); + vec.<a href="ntqvaluevector.html#push_back">push_back</a>( 100 ); + vec.<a href="ntqvaluevector.html#push_back">push_back</a>( 200 ); + vec.<a href="ntqvaluevector.html#push_back">push_back</a>( 300 ); + <a href="ntqvaluevector.html">TQValueVector</a><int> another; + qCopyBackward( vec.<a href="ntqvaluevector.html#begin">begin</a>(), vec.<a href="ntqvaluevector.html#end">end</a>(), another.<a href="ntqvaluevector.html#begin">begin</a>() ); // 'another' now contains 100, 200, 300 // however the elements are copied one at a time // in reverse order (300, 200, then 100) @@ -268,13 +268,13 @@ Just make sure that the right hand of the iterator has as many elements present as you want to insert. The following example illustrates this: <p> <pre> - <a href="qstringlist.html">TQStringList</a> list1, list2; + <a href="ntqstringlist.html">TQStringList</a> list1, list2; list1 << "Weis" << "Ettrich" << "Arnt" << "Sue"; list2 << "Torben" << "Matthias"; - qCopy( list2.begin(), list2.end(), list1.<a href="qvaluelist.html#begin">begin</a>() ); + qCopy( list2.begin(), list2.end(), list1.<a href="ntqvaluelist.html#begin">begin</a>() ); - <a href="qvaluevector.html">TQValueVector</a><TQString> vec( list1.<a href="qvaluelist.html#size">size</a>(), "Dave" ); - qCopy( list2.begin(), list2.end(), vec.<a href="qvaluevector.html#begin">begin</a>() ); + <a href="ntqvaluevector.html">TQValueVector</a><TQString> vec( list1.<a href="ntqvaluelist.html#size">size</a>(), "Dave" ); + qCopy( list2.begin(), list2.end(), vec.<a href="ntqvaluevector.html#begin">begin</a>() ); </pre> <p> At the end of this code fragment, the list list1 contains "Torben", @@ -296,19 +296,19 @@ a standard C++ array with qCopy(): <a name="3"></a><p> All the containers we've mentioned can be serialized with the appropriate streaming operators. Here is an example. <p> <pre> - <a href="qdatastream.html">TQDataStream</a> str(...); - <a href="qvaluelist.html">TQValueList</a><TQRect> list; + <a href="ntqdatastream.html">TQDataStream</a> str(...); + <a href="ntqvaluelist.html">TQValueList</a><TQRect> list; // ... fill the list here str << list; </pre> <p> The container can be read in again with: <p> <pre> - <a href="qvaluelist.html">TQValueList</a><TQRect> list; + <a href="ntqvaluelist.html">TQValueList</a><TQRect> list; str >> list; </pre> -<p> The same applies to <a href="qstringlist.html">TQStringList</a>, <a href="qvaluestack.html">TQValueStack</a> and <a href="qmap.html">TQMap</a>. +<p> The same applies to <a href="ntqstringlist.html">TQStringList</a>, <a href="ntqvaluestack.html">TQValueStack</a> and <a href="ntqmap.html">TQMap</a>. <!-- eof --> <p><address><hr><div align=center> |