From ffe8a83e053396df448e9413828527613ca3bd46 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:46:43 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- KDE2PORTING.html | 74 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'KDE2PORTING.html') diff --git a/KDE2PORTING.html b/KDE2PORTING.html index be2ec2d95..1154682c8 100644 --- a/KDE2PORTING.html +++ b/KDE2PORTING.html @@ -136,7 +136,7 @@ or this page online.

generalFont() and fixedFont() are deprecated and will be removed soon. Please use KGlobalSettings::generalFont() and KGlobalSettings::fixedFont() instead.

- appName() is deprecated. Please use QApplication::name() or instanceName + appName() is deprecated. Please use TQApplication::name() or instanceName instead.

The methods tempSaveName() and checkRecoverFile() return QString @@ -189,7 +189,7 @@ or this page online.

to klocale->translate with i18n.

The return value of i18n is also no longer a const char*, - but a unicode QString.

+ but a unicode TQString.

Return to the Table of Contents

@@ -216,7 +216,7 @@ must have created a KApplication object before the methods can be used.

     ...
         	KConfig *appcfg = KGlobal::config();
-	        QString mystr	 = i18n( "This is a string" );
+	        TQString mystr	 = i18n( "This is a string" );
 
 
 		KIconLoader *loader = KGlobal::iconLoader();
@@ -277,9 +277,9 @@ Both the "About KDE" and the "About <Application>" dialog boxes
 are now modeless. "About KDE" is a completely new widget.

If you used in the toplevel window (that is derived from KMainWindow) -"kapp->helpMenu( bool, QString )" to get the help menu -you must now change this to "helpMenu( QString )". The QString defaults -to QString::null so it is sufficient to write helpMenu().

+"kapp->helpMenu( bool, TQString )" to get the help menu +you must now change this to "helpMenu( TQString )". The TQString defaults +to TQString::null so it is sufficient to write helpMenu().

The old aboutKDE(), aboutApp() and appHelpActivated() of KApplication have all been removed. If you need direct access to these or need @@ -365,7 +365,7 @@ khtmlw has been replaced with khtml.
of the api has changed. In all functions:

      const char * -> QString
-     QStrList -> QStringList
+     TQStrList -> QStringList
   
The only exception for the moment is KHTMLWidget::write(), which does also exist in a const char * version.

@@ -373,7 +373,7 @@ khtmlw has been replaced with khtml.

  • you won't need the getKHTMLWiget function anymore. Just replace getKHTMLWidget->xxx() with xxx()

    -

  • xxx(QString) -> xxx(const QString &)

    +

  • xxx(TQString) -> xxx(const TQString &)

  • consistent naming. All getXyz() functions are renamed to xyz()

  • replaced/changed functions:

    @@ -386,8 +386,8 @@ khtmlw has been replaced with khtml.
    - - + + @@ -448,7 +448,7 @@ are necessary to convert your old KDND-based stuff to Qt DND.

  • You should be aware that to handle drops, you will either have to inherit a widget and then override the methods mentioned above, or install an event handler for the widget in that widget's parent, - and then handle QEvent::DragMove or QEvent::Drop inside there (if + and then handle TQEvent::DragMove or TQEvent::Drop inside there (if you want to avoid inheritance).

  • You can emulate the old DndURL drop-type behavior with the Qt Drag Object type QUriList.

    @@ -456,12 +456,12 @@ are necessary to convert your old KDND-based stuff to Qt DND.

    method if you wish.

  • Qt includes a Drag and Drop tutorial. We suggest you read that now if you are confused.

    -

  • QMultiLineEdit has already a DnD interface that accepts text/* +
  • TQMultiLineEdit has already a DnD interface that accepts text/* If you want to add support for other mimetypes, you need to re-implement all DnD-methods (also dragMoveEvent()) and pass QTextDrag's to the parent methods.

    -

  • QTextDrag also accepts text/uri-list, which means that you - always need to check for QUriDrag first if you want to get +
  • TQTextDrag also accepts text/uri-list, which means that you + always need to check for TQUriDrag first if you want to get both working.

  • The mimetype for Uri's is now text/uri-list. If you've used the proprietary Qt 1.x url/url, you need to adjust that. @@ -474,8 +474,8 @@ are necessary to convert your old KDND-based stuff to Qt DND.

    These classes have been largely re-implemented. The external API remains mostly the same, with the single notable change that the groupIterator and entryIterator methods have been removed and - instead replaced by groupList (which returns a QStringList of groups) - and entryMap(const QString &group) (which returns a QMap of entries + instead replaced by groupList (which returns a TQStringList of groups) + and entryMap(const TQString &group) (which returns a TQMap of entries in the specified group). This is due to internal changes in KConfig which would make providing iterators possibly rather difficult.

    @@ -487,8 +487,8 @@ are necessary to convert your old KDND-based stuff to Qt DND.

    this:

     
    -  QMap<QString, QString> tmpMap = config-<entryMap(myGroup);
    -  QMap<QString, QString>::Iterator aIt(tmpMap.begin());
    +  TQMap<TQString, TQString> tmpMap = config-<entryMap(myGroup);
    +  TQMap<TQString, TQString>::Iterator aIt(tmpMap.begin());
     
       for (; aIt != tmpMap.end(); ++aIt) {
        // body here.  Access iterator key as aIt.key(),
    @@ -537,7 +537,7 @@ Most applications will only need to replace kapp->getKCharsets() with
     KGlobal::charsets().

    For conversion of various input formats to QStrings, please have a -look at QTextCodec and classes derived from it.

    +look at TQTextCodec and classes derived from it.

    Character entities are now converted from and to QChars. The name has changed from convertTag to fromEntity and toEntity.

    @@ -551,7 +551,7 @@ input font most closely, but can display the given charset.

    KWizard, KNoteBook

    -KWizard is based on QWizard now. The API has changed. Consult Qt's +KWizard is based on TQWizard now. The API has changed. Consult Qt's documentation and kdelibs/kdetest/kwizardtest.cpp for an example use.

    KNoteBook (deeply entwined with the former KWizard) has been removed until someone is willing to port it to work with the new wizard. If you want to @@ -561,7 +561,7 @@ use it you'll find the necessary files in kdegraphics/kiconedit.

    KSpinBox, KNumericSpinBox

    -These classes have been replaced by QSpinBox. API is almost the same +These classes have been replaced by TQSpinBox. API is almost the same HINTS:

    • valueincreased()/valuedecreased -> valueChanged() @@ -580,16 +580,16 @@ version had, and more.

      KPanner, KNewPanner

      -KPanner and KNewPanner have been removed. QSplitter does everything +KPanner and KNewPanner have been removed. TQSplitter does everything KPanner did and more. The api is similar, but not compatible. Basically to set it up so that you have a vertical splitter between a listbox, a listview and multi line editor, you would do something like this:

  • -> contentsX/Y()
    getSelectedText(QString &)-> QString selectedText()getSelectedText(TQString &)-> TQString selectedText()
    findTextEnd() has vanished. just remove the call from your code
    - QSplitter *split = new QSplitter( parent );
    - QListBox *lb = new QListBox( split );
    + TQSplitter *split = new TQSplitter( parent );
    + TQListBox *lb = new TQListBox( split );
    KListView *lv = new KListView( split );
    - QMultiLineEdit *ed = new QMultiLineEdit( split ); + TQMultiLineEdit *ed = new TQMultiLineEdit( split );
    As you can see you are not limited to two children. Additionally, you @@ -600,26 +600,26 @@ possible if you call setOpaqueResize(true).

    KTreeList, KTreeListItem

    -Use KListView, QListViewItem instead. API is almost the same, you only +Use KListView, TQListViewItem instead. API is almost the same, you only need to add a Column (KListView::addColum) before KListView is useable.

    KListView has no addChild(), insertItem() and removeItem() calls. Inserting -a root item is done by constructing a QListViewItem with the KListView +a root item is done by constructing a TQListViewItem with the KListView passed as the parent widget. adding a child item is done by constructing -a QListViewItem with the parent item as parameter. removeItem() should +a TQListViewItem with the parent item as parameter. removeItem() should be replaced by delete <pointer to item>.

    The root items are not shown in a tree fashion by default. to get this, use KListView::setDecorativeRoot(true).

    -Expanding and collapsing can by done by using QListViewItem::setOpen(bool).

    +Expanding and collapsing can by done by using TQListViewItem::setOpen(bool).

    Return to the Table of Contents

    KMsgBox

    -KMsgBox has been superseded by QMessageBox. Which has been superseded +KMsgBox has been superseded by TQMessageBox. Which has been superseded by KMessageBox.

    • KMsgBox had return codes starting with 1 for the first button, 2 for @@ -642,7 +642,7 @@ KComboBox::setEditText.

      KQuickHelp

      -KQuickHelp, the "super-tooltip" widget, has been replaced by QWhatsThis. +KQuickHelp, the "super-tooltip" widget, has been replaced by TQWhatsThis. It provides a compatible API and almost the same look and feel, in addition to some new functionality.

      @@ -652,7 +652,7 @@ to some new functionality.

      Instead of old KPixmap::gradientFill, use:

      -KPixmapEffect::gradient(KPixmap&, QColor, QColor, enum KPixmapEffect::GradientType, int)

      +KPixmapEffect::gradient(KPixmap&, TQColor, TQColor, enum KPixmapEffect::GradientType, int)

      Hence:

      @@ -710,7 +710,7 @@ declared globally in kaccel.h are now static methods in KAccel.

      The KString class is obsolete and is not defined in kstring.h anymore. The header file only existed for compatibility reasons. -The file has been removed completely, use QString instead. (mirko@kde.org)

      +The file has been removed completely, use TQString instead. (mirko@kde.org)

      Return to the Table of Contents

      @@ -723,7 +723,7 @@ exist in KDE 2. (mirko@kde.org)

      kbutton.h / KButton

      -Since Qt 2.0, the class QToolButton provides the functionality of +Since Qt 2.0, the class TQToolButton provides the functionality of buttons that raise when the mouse is moved over them, so there is no reason to have a class providing the same feature in KDE libs. All occurrences of KButton in the KDE CVS have been replaced by QToolButtons, @@ -831,11 +831,11 @@ Werner Trobin <wtrobin@carinthia.com If you need some "inspiration" on how that could be done, please have a look -- cgit v1.2.1