@ -51,12 +51,12 @@ us support for most of the written languages around the world. Our <tt>Page</tt
<p><pre></pre>
<p> All functions that use the <tt>Page</tt> and <tt>Options</tt> structs need to be
updated to use TQString properly. Since TQString is also an <ahref="shclass.html#implicitly-shared">implicitly shared</a> class, we no longer have to do any memory management with our
strings. We can remove all occurences of the <ahref="ntqcstring.html#qstrdup">qstrdup</a>() function,
strings. We can remove all occurences of the <ahref="ntqcstring.html#qstrdup">tqstrdup</a>() function,
and we never need to use <em>new</em> or <em>delete</em> when done with a string.
TQString will allocate and delete data when needed.
<p> Here are the <tt>MainWindow::fileOpen()</tt> and <tt>MainWindow::pageChange()</tt>
functions from <tt>mainwindow.ui.h</tt>. Notice that the code no longer
uses <em>delete</em> or <ahref="ntqcstring.html#qstrdup">qstrdup</a>() when storing text.
uses <em>delete</em> or <ahref="ntqcstring.html#qstrdup">tqstrdup</a>() when storing text.
@ -127,7 +127,7 @@ number (with an indication that the page is invalid).
the new widgets in our <em>Main Window</em> widget.
<p> Note: <ahref="ntqtextedit.html#text">TQTextEdit::text</a>() returns a <ahref="ntqstring.html">TQString</a>, which needs to be converted
into a normal <tt>char*</tt> array. To do this we create a copy of the
string in the local encoding. We need to make the copy using <ahref="ntqcstring.html#qstrdup">qstrdup</a>() because the data contained in the <ahref="ntqcstring.html">TQCString</a> returned by
string in the local encoding. We need to make the copy using <ahref="ntqcstring.html#qstrdup">tqstrdup</a>() because the data contained in the <ahref="ntqcstring.html">TQCString</a> returned by
<ahref="ntqstring.html#local8Bit">TQString::local8Bit</a>() is deallocated when the TQCString is destroyed.
<p><pre></pre>
<p> The <tt>TextChanged()</tt> function does nothing more than set the <tt>modified</tt> variable to 1. Our new <tt>MainWindow::textChanged()</tt> function
@ -163,7 +163,7 @@ values.
currently displayed, so we use <ahref="ntqtextedit.html#text">TQTextEdit::text</a>() instead of <tt>XmTextGetString()</tt>. Note: TQTextEdit::text() returns a <ahref="ntqstring.html">TQString</a>, which
needs to be converted into a normal <tt>char*</tt> array. To do this we
create a copy of the string in the local encoding. We need to make
the copy using <ahref="ntqcstring.html#qstrdup">qstrdup</a>() because the data contained in the <ahref="ntqcstring.html">TQCString</a>
the copy using <ahref="ntqcstring.html#qstrdup">tqstrdup</a>() because the data contained in the <ahref="ntqcstring.html">TQCString</a>
returned by <ahref="ntqstring.html#local8Bit">TQString::local8Bit</a>() is deallocated when the TQCString is
<ahref="#qDebug">qDebug</a>( "my window handle = %x", myWidget->id() );
<ahref="#qDebug">tqDebug</a>( "my window handle = %x", myWidget->id() );
</pre>
<p> Under X11, the text is printed to stderr. Under Windows, the text
@ -1902,9 +1902,9 @@ is sent to the debugger.
the '\0'-terminator).
<p><b>Warning:</b> Passing (const char *)0 as argument to tqDebug might lead
to crashes on certain platforms due to the platforms printf implementation.
<p><p>See also <ahref="#qWarning">qWarning</a>(), <ahref="#qFatal">qFatal</a>(), <ahref="#qInstallMsgHandler">qInstallMsgHandler</a>(), and <ahref="debug.html">Debugging</a>.
<p><p>See also <ahref="#qWarning">tqWarning</a>(), <ahref="#qFatal">tqFatal</a>(), <ahref="#qInstallMsgHandler">qInstallMsgHandler</a>(), and <ahref="debug.html">Debugging</a>.
@ -1917,7 +1917,7 @@ similar to the C printf() function.
int divide( int a, int b )
{
if ( b == 0 ) // program error
<ahref="#qFatal">qFatal</a>( "divide: cannot divide by zero" );
<ahref="#qFatal">tqFatal</a>( "divide: cannot divide by zero" );
return a/b;
}
</pre>
@ -1928,7 +1928,7 @@ is sent to the debugger.
the '\0'-terminator).
<p><b>Warning:</b> Passing (const char *)0 as argument to tqFatal might lead
to crashes on certain platforms due to the platforms printf implementation.
<p><p>See also <ahref="#qDebug">qDebug</a>(), <ahref="#qWarning">qWarning</a>(), <ahref="#qInstallMsgHandler">qInstallMsgHandler</a>(), and <ahref="debug.html">Debugging</a>.
<p><p>See also <ahref="#qDebug">tqDebug</a>(), <ahref="#qWarning">tqWarning</a>(), <ahref="#qInstallMsgHandler">qInstallMsgHandler</a>(), and <ahref="debug.html">Debugging</a>.
@ -1977,19 +1977,19 @@ done on an application-wide basis to control debug output.
}
</pre>
<p><p>See also <ahref="#qDebug">qDebug</a>(), <ahref="#qWarning">qWarning</a>(), <ahref="#qFatal">qFatal</a>(), and <ahref="debug.html">Debugging</a>.
<p><p>See also <ahref="#qDebug">tqDebug</a>(), <ahref="#qWarning">tqWarning</a>(), <ahref="#qFatal">tqFatal</a>(), and <ahref="debug.html">Debugging</a>.
@ -2021,7 +2021,7 @@ similar to the C printf() function.
void f( int c )
{
if ( c > 200 )
<ahref="#qWarning">qWarning</a>( "f: bad argument, c == %d", c );
<ahref="#qWarning">tqWarning</a>( "f: bad argument, c == %d", c );
}
</pre>
@ -2031,7 +2031,7 @@ is sent to the debugger.
the '\0'-terminator).
<p><b>Warning:</b> Passing (const char *)0 as argument to tqWarning might lead
to crashes on certain platforms due to the platforms printf implementation.
<p><p>See also <ahref="#qDebug">qDebug</a>(), <ahref="#qFatal">qFatal</a>(), <ahref="#qInstallMsgHandler">qInstallMsgHandler</a>(), and <ahref="debug.html">Debugging</a>.
<p><p>See also <ahref="#qDebug">tqDebug</a>(), <ahref="#qFatal">tqFatal</a>(), <ahref="#qInstallMsgHandler">qInstallMsgHandler</a>(), and <ahref="debug.html">Debugging</a>.
@ -490,7 +490,7 @@ but the value is an arbitrary 32-bit value.
<p> The return type <em>TQRgb</em> is equivalent to <tt>unsigned</tt><tt>int</tt>.
<p> For an invalid color, the alpha value of the returned color is
unspecified.
<p><p>See also <ahref="#setRgb">setRgb</a>(), <ahref="#hsv">hsv</a>(), <ahref="#qRed">qRed</a>(), <ahref="#qBlue">qBlue</a>(), <ahref="#qGreen">qGreen</a>(), and <ahref="#isValid">isValid</a>().
<p><p>See also <ahref="#setRgb">setRgb</a>(), <ahref="#hsv">hsv</a>(), <ahref="#qRed">tqRed</a>(), <ahref="#qBlue">tqBlue</a>(), <ahref="#qGreen">tqGreen</a>(), and <ahref="#isValid">isValid</a>().
<p> This function is normally part of the C library. TQt implements
@ -1019,7 +1019,7 @@ positive value if <em>str1</em> is greater than <em>str2</em>.
<p> Special case I: Returns 0 if <em>str1</em> and <em>str2</em> are both 0.
<p> Special case II: Returns a random nonzero value if <em>str1</em> is 0
or <em>str2</em> is 0 (but not both).
<p><p>See also <ahref="#qstrncmp">qstrncmp</a>(), <ahref="#qstricmp">qstricmp</a>(), <ahref="#qstrnicmp">qstrnicmp</a>(), and <ahref="#asciinotion">Note on character comparisons</a>.
<p><p>See also <ahref="#qstrncmp">tqstrncmp</a>(), <ahref="#qstricmp">tqstricmp</a>(), <ahref="#qstrnicmp">tqstrnicmp</a>(), and <ahref="#asciinotion">Note on character comparisons</a>.
<p> Special case I: Returns 0 if <em>str1</em> and <em>str2</em> are both 0.
<p> Special case II: Returns a random nonzero value if <em>str1</em> is 0
or <em>str2</em> is 0 (but not both).
<p><p>See also <ahref="#qstrcmp">qstrcmp</a>(), <ahref="#qstrncmp">qstrncmp</a>(), <ahref="#qstrnicmp">qstrnicmp</a>(), and <ahref="#asciinotion">Note on character comparisons</a>.
<p><p>See also <ahref="#qstrcmp">qstrcmp</a>(), <ahref="#qstrncmp">tqstrncmp</a>(), <ahref="#qstrnicmp">tqstrnicmp</a>(), and <ahref="#asciinotion">Note on character comparisons</a>.
<p> Special case I: Returns 0 if <em>str1</em> and <em>str2</em> are both 0.
<p> Special case II: Returns a random nonzero value if <em>str1</em> is 0
or <em>str2</em> is 0 (but not both).
<p><p>See also <ahref="#qstrcmp">qstrcmp</a>(), <ahref="#qstricmp">qstricmp</a>(), <ahref="#qstrnicmp">qstrnicmp</a>(), and <ahref="#asciinotion">Note on character comparisons</a>.
<p><p>See also <ahref="#qstrcmp">qstrcmp</a>(), <ahref="#qstricmp">tqstricmp</a>(), <ahref="#qstrnicmp">tqstrnicmp</a>(), and <ahref="#asciinotion">Note on character comparisons</a>.
@ -1090,7 +1090,7 @@ is equal to <em>str2</em> or a positive value if <em>str1</em> is greater than <
<p> Special case I: Returns 0 if <em>str1</em> and <em>str2</em> are both 0.
<p> Special case II: Returns a random nonzero value if <em>str1</em> is 0
or <em>str2</em> is 0 (but not both).
<p><p>See also <ahref="#qstrcmp">qstrcmp</a>(), <ahref="#qstrncmp">qstrncmp</a>(), <ahref="#qstricmp">qstricmp</a>(), and <ahref="#asciinotion">Note on character comparisons</a>.
<p><p>See also <ahref="#qstrcmp">qstrcmp</a>(), <ahref="#qstrncmp">tqstrncmp</a>(), <ahref="#qstricmp">tqstricmp</a>(), and <ahref="#asciinotion">Note on character comparisons</a>.
@ -64,7 +64,7 @@ TQErrorMessage like this, you create the dialog in the usual way and call the
<ahref="#message">message</a>() slot, or connect signals to it.
<p><li> For developers. In this context the static <ahref="#qtHandler">qtHandler</a>() installs
a message handler using <ahref="ntqapplication.html#qInstallMsgHandler">qInstallMsgHandler</a>() and creates a TQErrorMessage
that displays <ahref="ntqapplication.html#qDebug">qDebug</a>(), <ahref="ntqapplication.html#qWarning">qWarning</a>() and <ahref="ntqapplication.html#qFatal">qFatal</a>() messages.
that displays <ahref="ntqapplication.html#qDebug">tqDebug</a>(), <ahref="ntqapplication.html#qWarning">tqWarning</a>() and <ahref="ntqapplication.html#qFatal">tqFatal</a>() messages.
</ol>
<p> In both cases TQErrorMessage will queue pending messages, and display
them (or not) in order, as soon as the user presses Enter or clicks OK
for ( TQStringList::Iterator f = families.<ahref="ntqvaluelist.html#begin">begin</a>(); f != families.<ahref="ntqvaluelist.html#end">end</a>(); ++f ) {
<ahref="ntqstring.html">TQString</a> family = *f;
<ahref="ntqapplication.html#qDebug">qDebug</a>( family );
<ahref="ntqapplication.html#qDebug">tqDebug</a>( family );
<ahref="ntqstringlist.html">TQStringList</a> styles = fdb.<ahref="#styles">styles</a>( family );
for ( TQStringList::Iterator s = styles.<ahref="ntqvaluelist.html#begin">begin</a>(); s != styles.<ahref="ntqvaluelist.html#end">end</a>(); ++s ) {
<ahref="ntqstring.html">TQString</a> style = *s;
@ -126,7 +126,7 @@ int main( int argc, char **argv )
@ -160,7 +160,7 @@ data. 1-bpp and 8-bpp images use a color lookup table; the pixel
value is a color table index.
<p> 32-bpp images encode an RGB value in 24 bits and ignore the color
table. The most significant byte is used for the <ahref="#setAlphaBuffer">alpha buffer</a>.
<p> An entry in the color table is an RGB triplet encoded as a <tt>uint</tt>. Use the <ahref="ntqcolor.html#qRed">qRed()</a>, <ahref="ntqcolor.html#qGreen">qGreen()</a> and <ahref="ntqcolor.html#qBlue">qBlue()</a> functions (<ahref="qcolor-h.html">ntqcolor.h</a>) to access the components, and <ahref="ntqcolor.html#qRgb">qRgb</a> to make an RGB triplet (see the <ahref="ntqcolor.html">TQColor</a> class
<p> An entry in the color table is an RGB triplet encoded as a <tt>uint</tt>. Use the <ahref="ntqcolor.html#qRed">tqRed()</a>, <ahref="ntqcolor.html#qGreen">tqGreen()</a> and <ahref="ntqcolor.html#qBlue">tqBlue()</a> functions (<ahref="qcolor-h.html">ntqcolor.h</a>) to access the components, and <ahref="ntqcolor.html#qRgb">tqRgb</a> to make an RGB triplet (see the <ahref="ntqcolor.html">TQColor</a> class
documentation).
<p> 1-bpp (monochrome) images have a color table with a most two
colors. There are two different formats: big endian (MSB first) or
@ -194,7 +194,7 @@ significant byte is reserved for the alpha buffer.
<p> On TQt/Embedded, scanlines are aligned to the pixel depth and may
@ -384,7 +384,7 @@ to <a href="#numBytes">numBytes</a>()/height().
<p> Returns the color in the color table at index <em>i</em>. The first
color is at index 0.
<p> A color value is an RGB triplet. Use the <ahref="ntqcolor.html#qRed">qRed()</a>, <ahref="ntqcolor.html#qGreen">qGreen()</a> and <ahref="ntqcolor.html#qBlue">qBlue()</a> functions (defined in <ahref="qcolor-h.html">ntqcolor.h</a>) to
<p> A color value is an RGB triplet. Use the <ahref="ntqcolor.html#qRed">tqRed()</a>, <ahref="ntqcolor.html#qGreen">tqGreen()</a> and <ahref="ntqcolor.html#qBlue">tqBlue()</a> functions (defined in <ahref="qcolor-h.html">ntqcolor.h</a>) to
get the color value components.
<p><p>See also <ahref="#setColor">setColor</a>(), <ahref="#numColors">numColors</a>(), and <ahref="ntqcolor.html">TQColor</a>.
@ -768,7 +768,7 @@ output.
Returns the color of the pixel at the coordinates (<em>x</em>, <em>y</em>).
<p> If (<em>x</em>, <em>y</em>) is not <ahref="#valid">on the image</a>, the
results are undefined.
<p><p>See also <ahref="#setPixel">setPixel</a>(), <ahref="ntqcolor.html#qRed">qRed</a>(), <ahref="ntqcolor.html#qGreen">qGreen</a>(), <ahref="ntqcolor.html#qBlue">qBlue</a>(), and <ahref="#valid">valid</a>().
<p><p>See also <ahref="#setPixel">setPixel</a>(), <ahref="ntqcolor.html#qRed">tqRed</a>(), <ahref="ntqcolor.html#qGreen">tqGreen</a>(), <ahref="ntqcolor.html#qBlue">tqBlue</a>(), and <ahref="#valid">valid</a>().
<p>Examples: <ahref="canvas-example.html#x2933">canvas/canvas.cpp</a> and <ahref="qmag-example.html#x1776">qmag/qmag.cpp</a>.
pointer to <tt>TQRgb*</tt> (TQRgb has a 32-bit size) and use it to
read/write the pixel value. You cannot use the <tt>uchar*</tt> pointer
directly, because the pixel format depends on the byte order on
the underlying platform. Hint: use <ahref="ntqcolor.html#qRed">qRed()</a>,
<ahref="ntqcolor.html#qGreen">qGreen()</a> and <ahref="ntqcolor.html#qBlue">qBlue()</a>, etc. (ntqcolor.h) to access the pixels.
the underlying platform. Hint: use <ahref="ntqcolor.html#qRed">tqRed()</a>,
<ahref="ntqcolor.html#qGreen">tqGreen()</a> and <ahref="ntqcolor.html#qBlue">tqBlue()</a>, etc. (ntqcolor.h) to access the pixels.
<p><b>Warning:</b> If you are accessing 16-bpp image data, you must handle
endianness yourself. (TQt/Embedded only)
<p><p>See also <ahref="#bytesPerLine">bytesPerLine</a>(), <ahref="#bits">bits</a>(), and <ahref="#jumpTable">jumpTable</a>().
@ -897,7 +897,7 @@ to a <a href="ntqpixmap.html">TQPixmap</a>.
</h3>
<p> Sets a color in the color table at index <em>i</em> to <em>c</em>.
<p> A color value is an RGB triplet. Use the <ahref="ntqcolor.html#qRgb">qRgb()</a> function (defined in <ahref="qcolor-h.html">ntqcolor.h</a>) to make RGB
<p> A color value is an RGB triplet. Use the <ahref="ntqcolor.html#qRgb">tqRgb()</a> function (defined in <ahref="qcolor-h.html">ntqcolor.h</a>) to make RGB
triplets.
<p><p>See also <ahref="#color">color</a>(), <ahref="#setNumColors">setNumColors</a>(), and <ahref="#numColors">numColors</a>().
@ -928,7 +928,7 @@ Sets the pixel index or color at the coordinates (<em>x</em>, <em>y</em>) to
<p> If (<em>x</em>, <em>y</em>) is not <ahref="#valid">valid</a>, the result is
undefined.
<p> If the image is a paletted image (<ahref="#depth">depth</a>() <= 8) and <em>index_or_rgb</em>>= <ahref="#numColors">numColors</a>(), the result is undefined.
<p><p>See also <ahref="#pixelIndex">pixelIndex</a>(), <ahref="#pixel">pixel</a>(), <ahref="ntqcolor.html#qRgb">qRgb</a>(), <ahref="ntqcolor.html#qRgba">qRgba</a>(), and <ahref="#valid">valid</a>().
<p><p>See also <ahref="#pixelIndex">pixelIndex</a>(), <ahref="#pixel">pixel</a>(), <ahref="ntqcolor.html#qRgb">tqRgb</a>(), <ahref="ntqcolor.html#qRgba">tqRgba</a>(), and <ahref="#valid">valid</a>().
<p>This property holds whether this widget (or its focus proxy) has the keyboard input focus.
<p>Effectively equivalent to <tt>qApp->focusWidget() == this</tt>.
<p>Effectively equivalent to <tt>tqApp->focusWidget() == this</tt>.
<p><p>See also <ahref="#setFocus">setFocus</a>(), <ahref="#clearFocus">clearFocus</a>(), <ahref="#focusPolicy-prop">focusPolicy</a>, and <ahref="ntqapplication.html#focusWidget">TQApplication::focusWidget</a>().
<p>Get this property's value with <ahref="#hasFocus">hasFocus</a>().
@ -65,7 +65,7 @@ by default in the standard plugin directory.
run, TQt will first treat the application's executable directory as the
<tt>pluginsbase</tt>. For example if the application is in <tt>C:\Program Files\MyApp</tt> and has a style plugin, TQt will look in <tt>C:\Program Files\MyApp\styles</tt>. (See <ahref="ntqapplication.html#applicationDirPath">TQApplication::applicationDirPath</a>() for
how to find out where the application's executable is.) TQt will also
look in the directory given by <tt>qInstallPathPlugins()</tt>. If you want
look in the directory given by <tt>tqInstallPathPlugins()</tt>. If you want
TQt to look in additional places you can add as many paths as you need
with calls to <ahref="ntqapplication.html#addLibraryPath">TQApplication::addLibraryPath</a>(). And if you want to
<aname="x2149"></a> if ( ! defaultDB-><ahref="ntqsqldatabase.html#open">open</a>() ) {
<aname="x2148"></a><ahref="ntqapplication.html#qWarning">qWarning</a>( "Failed to open sales database: " + defaultDB-><ahref="ntqsqldatabase.html#lastError">lastError</a>().text() );
<aname="x2148"></a><ahref="ntqapplication.html#qWarning">tqWarning</a>( "Failed to open sales database: " + defaultDB-><ahref="ntqsqldatabase.html#lastError">lastError</a>().text() );
return FALSE;
}
@ -324,7 +324,7 @@ function in <tt>connection.h</tt>.
if ( ! oracle-><ahref="ntqsqldatabase.html#open">open</a>() ) {
<ahref="ntqapplication.html#qWarning">qWarning</a>( "Failed to open orders database: " + oracle-><ahref="ntqsqldatabase.html#lastError">lastError</a>().text() );
<ahref="ntqapplication.html#qWarning">tqWarning</a>( "Failed to open orders database: " + oracle-><ahref="ntqsqldatabase.html#lastError">lastError</a>().text() );
return FALSE;
}
@ -570,7 +570,7 @@ retrieve data from it.
<ahref="ntqsqlquery.html">TQSqlQuery</a> query( "SELECT id, surname FROM staff" );
<aname="x2175"></a> if ( query.<ahref="ntqsqlquery.html#isActive">isActive</a>() ) {
<aname="x2176"></a> while ( query.<ahref="ntqsqlquery.html#next">next</a>() ) {