From ea318d1431c89e647598c510c4245c6571aa5f46 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 26 Jan 2012 23:32:43 -0600 Subject: Update to latest tqt3 automated conversion --- doc/html/porting.html | 430 +++++++++++++++++++++++++------------------------- 1 file changed, 215 insertions(+), 215 deletions(-) (limited to 'doc/html/porting.html') diff --git a/doc/html/porting.html b/doc/html/porting.html index c812b21cf..c5058a8be 100644 --- a/doc/html/porting.html +++ b/doc/html/porting.html @@ -163,46 +163,46 @@ set any relevant preprocessor defines in the makefile. header files. This speeds up compilation when you don't need those nested header files. But in some cases you will find you need to add an extra #include to your files. -

For example, if you get a message about TQStringList or its functions -not being defined, then add #include <qstringlist.h> at +

For example, if you get a message about TQStringList or its functions +not being defined, then add #include <ntqstringlist.h> at the top of the file giving the error.

Header files that you might need to add #include directives for include:

Namespace

TQt 3.x is namespace clean. A few global identifiers that had been left in TQt 2.x have been discarded. -

Enumeration TQt::CursorShape and its values are now part of the -special TQt class defined in qnamespace.h. If you get compilation +

Enumeration TQt::CursorShape and its values are now part of the +special TQt class defined in ntqnamespace.h. If you get compilation errors about these being missing (unlikely, since most of your code will be in classes that inherit from the TQt namespace class), then apply the following changes:

The names of some debugging macro variables have been changed. We have tried not to break source compatibility as much as possible. If you observe @@ -269,119 +269,119 @@ rather than the documentation supplied with TQt to obtain the latest information regarding obsolete functions and how to replace them in new code.

Additionally, these preprocessor directives have been removed: @@ -405,27 +405,27 @@ and TQVector have been renamed. To ease porting, the old names and the old header-file names are still supported.

Old Name New Name New Header File -
TQArray TQMemArray <qmemarray.h> -
TQCollection TQPtrCollection <qptrcollection.h> -
TQList TQPtrList <qptrlist.h> -
TQListIterator TQPtrListIterator <qptrlist.h> -
TQQueue TQPtrQueue <qptrqueue.h> -
TQStack TQPtrStack <qptrstack.h> -
TQVector TQPtrVector <qptrvector.h> +
TQArray TQMemArray <ntqmemarray.h> +
TQCollection TQPtrCollection <ntqptrcollection.h> +
TQList TQPtrList <ntqptrlist.h> +
TQListIterator TQPtrListIterator <ntqptrlist.h> +
TQQueue TQPtrQueue <ntqptrqueue.h> +
TQStack TQPtrStack <ntqptrstack.h> +
TQVector TQPtrVector <ntqptrvector.h>
-

TQButtonGroup +

TQButtonGroup

-

In TQt 2.x, the function TQButtonGroup::selected() returns the selected -radio button (TQRadioButton). In TQt 3.0, it returns the selected toggle button (TQButton::toggleButton), a more general concept. +

In TQt 2.x, the function TQButtonGroup::selected() returns the selected +radio button (TQRadioButton). In TQt 3.0, it returns the selected toggle button (TQButton::toggleButton), a more general concept. This might affect programs that use TQButtonGroups that contain a -mixture of radio buttons and non-radio (e.g. TQCheckBox) toggle buttons. +mixture of radio buttons and non-radio (e.g. TQCheckBox) toggle buttons.

TQDate

Two TQDate member functions that were virtual in TQt 2.0 are not virtual in TQt 3.0. This is only relevant if you subclassed TQDate and reimplemented these functions:

In addition to no longer being virtual, TQDate::monthName() and @@ -433,13 +433,13 @@ TQDate::dayName() have been renamed TQDate:: TQDate::shortDayName() and have been made static (as they should had been in the first place). The old names are still provided for source compatibility. -

TQFileDialog +

TQFileDialog

If the mode was not set explicitly, and the user entered a non-existent file, the dialog would accept this. In TQt 3.x, you must set the mode, e.g. setMode(TQFileDialog::AnyFile), to get the same behavior. -

TQFont +

TQFont

The internals of TQFont have changed significantly between TQt 2.2 and TQt 3.0, to give better Unicode support and to make developing @@ -452,23 +452,23 @@ TQFont::charSet() or TQFont::setCharSet(), just remove them from your code. There are a few functions that took a TQFont::CharSet as a parameter; in these cases simply remove the charset from the parameter list. -

TQInputDialog +

TQInputDialog

The two static getText(...) methods in TQInputDialog have been merged. The echo parameter is the third parameter and defaults to TQLineEdit::Normal. -

If you used calls to TQInputDialog::getText(...) that provided more +

If you used calls to TQInputDialog::getText(...) that provided more than the first two required parameters you will must add a value for the echo parameter. -

TQLayout and Other Abstract Layout Classes +

TQLayout and Other Abstract Layout Classes

-

The definitions of TQGLayoutIterator, TQLayout, TQLayoutItem, TQLayoutIterator, TQSpacerItem and TQWidgetItem have been moved from <qabstractlayout.h> to <qlayout.h>. The header <qabstractlayout.h> now includes <qlayout.h> for compatibility. It +

The definitions of TQGLayoutIterator, TQLayout, TQLayoutItem, TQLayoutIterator, TQSpacerItem and TQWidgetItem have been moved from <ntqabstractlayout.h> to <ntqlayout.h>. The header <ntqabstractlayout.h> now includes <ntqlayout.h> for compatibility. It might be removed in a future version.

TQListViewItem

The paintBranches() function in TQt 2.x had a GUIStyle parameter; this has been dropped for TQt 3.x since GUI style is handled by the new -style engine (See TQStyle.) +style engine (See TQStyle.)

TQMoveEvent

In TQt 2.x, the function TQMoveEvent::pos() returned the position of the @@ -480,7 +480,7 @@ top level widgets.

The TQMultiLineEdit was a simple editor widget in previous TQt versions. Since TQt 3.0 includes a new richtext engine, which also supports editing, TQMultiLineEdit is obsolete. For the sake of compatibility -TQMultiLineEdit is still provided. It is now a subclass of TQTextEdit +TQMultiLineEdit is still provided. It is now a subclass of TQTextEdit which wraps the old TQMultiLineEdit so that it is mostly source compatible to keep old applications working.

For new applications and when maintaining existing applications we @@ -504,12 +504,12 @@ been renamed to TQtMultiLineEdit to avoid name clashes. If you really need to keep compatibility with the old TQMultiLineEdit, simply include this class in your project and rename TQMultiLineEdit to TQtMultiLineEdit throughout. -

TQPrinter +

TQPrinter

TQPrinter has undergone some changes, to make it more flexible and to ensure it has the same runtime behaviour on both Unix and Windows. In 2.x, TQPrinter behaved differently on Windows and Unix, when using view -transformations on the TQPainter. This has changed now, and TQPrinter +transformations on the TQPainter. This has changed now, and TQPrinter behaves consistently across all platforms. A compatibilty mode has been added that forces the old behaviour, to ease porting from TQt 2.x to TQt 3.x. This compatibilty mode can be enabled by passing the @@ -517,13 +517,13 @@ TQPrinter::Compatible flag to the TQPrinter constructor.

On X11, TQPrinter used to generate encapsulated postscript when fullPage() was TRUE and only one page was printed. This does not happen by default anymore, providing a more consistent printing output. -

TQRegExp +

TQRegExp

-

The TQRegExp class has been rewritten to support many of the features of Perl -regular expressions. Both the regular expression syntax and the TQRegExp +

The TQRegExp class has been rewritten to support many of the features of Perl +regular expressions. Both the regular expression syntax and the TQRegExp interface have been modified. -

Be also aware that <qregexp.h> is no longer included -automatically when you include <qstringlist.h>. See +

Be also aware that <ntqregexp.h> is no longer included +automatically when you include <ntqstringlist.h>. See above for details.

New special characters @@ -535,40 +535,40 @@ of these (actually, \\ in C++ strings), unless it is already there.

Example: Old code like

-    TQRegExp rx( "([0-9|]*\\)" );        // works in TQt 2.x
+    TQRegExp rx( "([0-9|]*\\)" );        // works in TQt 2.x
 
should be converted into
-    TQRegExp rx( "\\([0-9\\|]*\\)" );      // works in TQt 2.x and 3.x
+    TQRegExp rx( "\\([0-9\\|]*\\)" );      // works in TQt 2.x and 3.x
 
(Within character classes, the backslash is not necessary in front of certain characters, e.g. |, but it doesn't hurt.)

Wildcard patterns need no conversion. Here are two examples:

-    TQRegExp wild( "(*.*)" );
-    wild.setWildcard( TRUE );
+    TQRegExp wild( "(*.*)" );
+    wild.setWildcard( TRUE );
 
     // TRUE as third argument means wildcard
-    TQRegExp wild( "(*.*)", FALSE, TRUE );
+    TQRegExp wild( "(*.*)", FALSE, TRUE );
 
-However, when they are used, make sure to use TQRegExp::exactMatch() -rather than the obsolete TQRegExp::match(). TQRegExp::match(), like +However, when they are used, make sure to use TQRegExp::exactMatch() +rather than the obsolete TQRegExp::match(). TQRegExp::match(), like TQRegExp::find(), tries to find a match somewhere in the target string, while TQRegExp::exactMatch() tries to match the whole target string. -

TQRegExp::operator=() +

TQRegExp::operator=()

-

This function has been replaced by TQRegExp::setPattern() in TQt 2.2. +

This function has been replaced by TQRegExp::setPattern() in TQt 2.2. Old code such as

-    TQRegExp rx( "alpha" );
-    rx.setCaseSensitive( FALSE );
-    rx.setWildcard( TRUE );
+    TQRegExp rx( "alpha" );
+    rx.setCaseSensitive( FALSE );
+    rx.setWildcard( TRUE );
     rx = "beta";
 
@@ -589,17 +589,17 @@ which is what one expects.

The following function is now obsolete, as it has an unwieldy parameter list and was poorly named:

-It will be removed in a future version of TQt. Its documentation explains how to replace it. +It will be removed in a future version of TQt. Its documentation explains how to replace it.

TQRegExp::find()

This function was removed, after a brief appearance in TQt 2.2. Its -name clashed with TQString::find(). Use TQRegExp::search() or TQString::find() instead. -

TQString::findRev() and TQString::contains() +name clashed with TQString::find(). Use TQRegExp::search() or TQString::find() instead. +

TQString::findRev() and TQString::contains()

-

TQString::findRev()'s and TQString::contains()'s semantics have changed +

TQString::findRev()'s and TQString::contains()'s semantics have changed between 2.0 and 3.0 to be more consistent with the other overloads.

For example,

@@ -614,13 +614,13 @@ start of input, so
  
 returns 1, not 13 or 14.
 

This change affect very few existing programs. -

TQString::replace() +

TQString::replace()

-

With TQt 1.0 and 2.0, a TQString is converted implicitly into a TQRegExp +

With TQt 1.0 and 2.0, a TQString is converted implicitly into a TQRegExp as the first argument to TQString::replace():

-    TQString text = fetch_it_from_somewhere();
-    text.replace( TQString("[A-Z]+"), "" );
+    TQString text = fetch_it_from_somewhere();
+    text.replace( TQString("[A-Z]+"), "" );
 
With TQt 3.0, the compiler gives an error. The solution is to use a @@ -638,26 +638,26 @@ without breaking source compatibility. modal dialog instead.

TQSortedList

-

The TQSortedList class is now obsolete. Consider using a TQDict, a TQMap -or a plain TQPtrList instead. +

The TQSortedList class is now obsolete. Consider using a TQDict, a TQMap +or a plain TQPtrList instead.

TQTableView

The TQTableView class has been obsoleted and is no longer a part of the -TQt API. Either use the powerful TQTable class or the simplistic -TQGridView in any new code you create. If you really need the old table +TQt API. Either use the powerful TQTable class or the simplistic +TQGridView in any new code you create. If you really need the old table view for compatibility you can find it in $QTDIR/src/attic/qttableview.{cpp,h}. Note that the class has been renamed from TQTableView to TQtTableView to avoid name clashes. To use it, simply include it in your project and rename TQTableView to TQtTableView throughout. -

TQToolButton +

TQToolButton

-

The TQToolButton class used to distinguish between "on" and "off" -icons. In 3.0, this mechanism was moved into the TQIconSet class -(see TQIconSet::State). -

The old TQToolButton::onIconSet and TQToolButton::offIconSet +

The TQToolButton class used to distinguish between "on" and "off" +icons. In 3.0, this mechanism was moved into the TQIconSet class +(see TQIconSet::State). +

The old TQToolButton::onIconSet and TQToolButton::offIconSet properties are still provided so that old source will compile, but -their semantics have changed: they are now synonyms for TQToolButton::iconSet. If you used that distinction in TQt 2.x, you will -need to adjust your code to use the TQIconSet On/Off mechanism. +their semantics have changed: they are now synonyms for TQToolButton::iconSet. If you used that distinction in TQt 2.x, you will +need to adjust your code to use the TQIconSet On/Off mechanism.

Likewise, the on parameter of these two functions is now ignored: