As a start you should have a look at doc/porting.doc in the Qt package, or this page online.
Please note that we tried to be mostly source-compatible where it was possible. To accomplish that, we added commonly used but still deprecated / removed API parts in a #ifndef KDE_NO_COMPAT-block. That means you can "test" and adjust your application by #defining KDE_NO_COMPAT for compiling and see where it breaks. This is recommended, as those backward compatibility "hacks" are not kept for long.
WARNING:In some cases the names or signatures of signals or slots have changed. Check your source carefully for this since these changes will not be discovered by your compiler but will result in incorrect runtime behavior if left uncorrected in your application.
Return to the Table of Contents
Return to the Table of Contents
It is no longer possible to make calls to an application registered as
" Return to the Table of Contents
Method KAction::hasIconSet() has been renamed to KAction::hasIcon(), the old name will still work unless KDE_NO_COMPAT is defined.
KAction::iconSet() now has an argument specifying icon group, the old KAction::iconSet() is still available unless KDE_NO_COMPAT
is defined and returns KIcon::Small iconset, just like in KDE2.
KToolBarButton methods setPixmap(), setDefaultPixmap(), setDisabledPixmap(), setDefaultIcon() and setDisabledIcon() are deprecated.
Use KToolBarButton::setIcon() (preferred) or KToolBarButton::setIconSet() instead.
Return to the Table of Contents Return to the Table of Contents
The Return to the Table of Contents Return to the Table of Contents In TDEHTMLView, the following changes were done:
Return to the Table of Contents
Even if the list of changes is long, the affected code base should be relatively small, as most
parts are rarely used outside of tdefile.
The changes are:
State-changes are now signaled solely via the KFileViewSignaler object, that every KFileView
has a protected member of ("sig"). The methods activateMenu(), highlight() and select() have
been removed. If you implemented a KFileView, change your code in the following way:
Return to the Table of Contents
Return to the Table of Contents
The API for Kicker panel applets and extensions has changed. Panels can now be
left/top, center, or right/bottom aligned, and applets and extensions may receive
notification about a change in alignment.
The virtual methods orientationChange() and popupDirectionChange() are deprecated.
Instead you should reimplement positionChange() and alignmentChange() to be
notified of changes in the position and alignment of the panel on which your applet
resides. In addition, the popupDirection() method and the Direction enum are
deprecated. Instead you should use the position() method and Position enum. Applets that use
the deprecated methods will still work with KDE 3, but may not compile or work with
a future version.
There is a new method alignmentChange() that your extension should reimplement if
it needs to know about changes in alignment.
Return to the Table of Contents
Dirk Mueller mueller@kde.org
KLibFactory
KLibFactory's create method is no more virtual and the createObject method
is now pure virtual. The former was marked as deprecated since KDE 2.0.
All it takes in your component is to rename your existing create implementation
to createObject and remove the 'emit objectCreated( yourObject );' line.
KDesktopFile
The filename() method has been renamed to fileName().
The old name will still work unless KDE_NO_COMPAT is defined.
KPixmapSplitter
KPixmapSplitter has now been moved to the new tdefx library.
KStringHandler
The matchFilename( const TQString& filename, const TQString& pattern ) method has been
renamed to
matchFileName( const TQString& filename, const TQString& pattern ).
The old name will still work unless KDE_NO_COMPAT is defined.
KStyle
Due to the major changes in the TQStyle API in Qt3, KStyle has been completely
re-written. KStyle is now a thin wrapper around TQCommonStyle with a few extra
primitive elements and a simple popupMenu transparency engine. All KStyles can
now style Qt apps like designer and assistant automatically. KStyle is no longer
present in tdecore. It is now in a new library called tdefx to allow Qt apps to
use KDE's styles without having the styles linked to tdecore/tdeui.
KURL
The filename( bool _ignore_trailing_slash_in_path = true ) method has been
renamed to
fileName( bool _ignore_trailing_slash_in_path = true ).
The old name will still work unless KDE_NO_COMPAT is defined.
KMD5
HASHHEX and HASH has been removed to make this class namespace clean.
They have been replaced by TQCString and KMD5::Digest.
The API has been cleaned up, it is no longer necessary to call finalize().
Simply remove any calls to it.
KLocale
Accelerators Keys
KAccel
The following methods of been deprecated, and if KDE_NO_COMPAT is defined they will
not be available.
The preferred means of defining a shortcut, however, is to use KAction.
- kaccel->insertItem( i18n("Scroll Up"), "Scroll Up", "Up" );
- kaccel->connectItem( "Scroll Up", this, TQT_SLOT(scrollUp()) );
+ kaccel->insert( "Scroll Up", i18n("Scroll Up"), TQString::null,
Key_Up, this, TQT_SLOT(scrollUp()) );
Note that a What's This parameter is now a part of the insert function.
You might replace the TQString::null parameter with
i18n("Scroll the current document's contents up by one line.")
for example.
- kaccel->changeMenuAccel( menu, id, "file_open" );
+ menu->setAccel( kaccel->shortcut( "file_open" ).keyCodeQt(), id );
new KAction( i18n("Scroll Up"), Key_Up,
this, TQT_SLOT(scrollUp()), actionCollection(), "Scroll Up" );
TDEGlobalAccel
KStdAccel
Old New TQString action(StdAccel id) TQString name(StdAccel id) int defaultKey(StdAccel accel) KShortcut shortcutDefault(StdAccel id) TQString description(StdAccel id) TQString label(StdAccel id) bool isEqual(const TQKeyEvent* pEvent, int keyQt)
The best method for replacing this varies. One possibility is to use
KKey(const TQKeyEvent*) == KKey(int). Another is to use
KShortcut::contains( const KKey&/KKeySequence& ). int key(StdAccel) const KShortcut& shortcut(StdAccel) KIconLoader, KIconTheme
Methods now use KIcon::Group and KIcon::Context instead of int as types for group and context arguments.
The change should affect only code using hardcoded numeric values instead of using the proper enum constants.
This applies to classes KIconLoader, KIconTheme and (in kio and tdefile) KMimeType, KService, KIconDialog, KIconButton,
KURLBar and KURLBarItem.
Changes in tdeui
KAccelMenu
This class has been removed, Qt offers the same functionality.
Use QPopupMenu/KPopupMenu or the XML-UI method for building menus.
KAction
Old New int accel() const KShortcut& shortcut() int menuId() int itemId() void setAccel(int) void setShortcut(const KShortcut&) KActionCollection
KAlphaPainter
KAlphaPainter has been dropped, since Qt 3 has native support for
hardware accelerated alpha blending.
KAnimWidget
This class no longer supports reading a list of images, instead it uses a
single image-file that has been prepared with the kimage_concat tool.
See tdelibs/pics/hicolor/kde for an example of its use.
KContainerLayout
This class has been removed, use Qt layouts instead.
KCommand
This class has been made lighter: the name isn't stored into the command anymore,
but must be provided by the inherited class, as the result of the virtual name() function.
This saves storing a TQString into each command in memory.
The former behavior is available in the class KNamedCommand, so for a quick port
simply replace KCommand with KNamedCommand.
KDialogBase
The deprecated getMainWidget() method has been removed. Use mainWidget() instead.
KDirectionButton
...is gone. Use KArrowButton instead, it offers about the same
functionality.
KDockWidget
The WidgetList parameter has been renamed to TQWidgetList. Behaviour
is identical.
KEdit
KEdit is now deprecated. You should use use KTextEditor::Editor or
KTextEdit instead.
KImageEffect
KImageEffect has now been moved to the new tdefx library.
KMessageBox
KMessageBox now does automatic line-breaking. When using plain-text, you should
remove any mid-sentence linebreaks. Only use line-breaks to indicate the end of
a paragraph.
KPanelApplet
A new protected member method 'void reportBug()' was added. It gets called by
Kicker if the 'Report Bug' entry in the context menu gets selected and should
be overridden by applets which support the KPanelApplet::ReportBug action. This
means that you don't have to extend KPanelApplet's generic action dispatcher
void KPanelApplet::action() anymore.
KPanelMenu
The old KPanelMenu class has been renamed to KPanelAppMenu. The KPanelMenu
class now corresponds to a new Kicker menu extension that is handled
by the panel in a way similar to other applets (shared library loaded
at run-time). See KDE 3.0 documentation
for more informations on this new extension.
KPixmapEffect
PixmapEffect has now been moved to the new tdefx library.
KProgress
KProgress is now based on TQProgressBar.
This has led to a few API changes. In particular the constructors have been
simplified, you simply need to pass the total number of steps instead of
min / max / initialvalue / orientation. See documentation of both KProgress
and TQProgressBar.
KRootPixmap
The KRootPixmap class has been extended to make it more flexible, and the
checkAvailable(bool ignored) method has been renamed to isAvailable().
The old name will still work unless KDE_NO_COMPAT is defined.
KThemeBase, KThemeStyle
KThemeBase and KThemeStyle have been ported over to the new QStyle/KStyle API
present in Qt3/KDE3. KThemeBase is no longer in tdeui, but in kstyles/kthemestyle
as its use is basically limited to KThemeStyle.
KAction, KToolBar, KToolBarButton and icons
The preferred way for specifying icons is passing the icon names (and the icons will be loaded by KIconLoader),
instead of using TQIconSet or TQPixmap. This results in always using the correct icon size and allows delayed
on-demand icon loading.
KAction and derived classes
The protected set* methods have been renamed to update* and they now take only one argument (i.e. setText(int, const TQString&)
is now updateText(int) ). Because the former second argument was always the value of the a corresponding data member, you
can simply call the accessor method (i.e. in updateText() call text() to get the text).
KToggleAction
exclusiveGroup() is no more virtual. setExclusiveGroup(const
TQString&) is not a slot anymore.
Changes in kio
KPropertiesDialog
KTarGz/KTarBase/KTarData
KOpenWithHandler / KFileOpenWithHandler
Those two classes are deprecated, no need to create a KFileOpenWithHandler anymore.
The merging of libtdeio, libtdesycoca, libtdefile and libkssl into a single libtdeio has
allowed to fix this dependency problem: KRun can now use the OpenWith dialog directly.
KMimeType, KService
Methods now use KIcon::Group and KIcon::Context instead of int as types for group and context arguments.
The change should affect only code using hardcoded numeric values instead of using the proper enum constants.
KFilterDev
The createFilterDevice method is deprecated. Use deviceForFile instead.
KDirWatch
Changes in tdeparts
KParts::Factory
The createPart method is no more virtual and the createPartObject method
is now pure virtual. The former was marked as deprecated since KDE 2.0.
All it takes in your component is to rename your existing createPart implementation
to createPartObject and remove the 'emit objectCreated( yourObject );' line.
KParts::Part
The bool isSelectable() const
is no more virtual. So when you want to
change the behavior of the selectable property you don't need to re-implement
both virtual functions, setSelectable and isSelectable, but instead just
re-implementing setSelectable does the job. The very same applies for
the KURL url() const
and ReadWritePart's bool isReadWrite const
and bool isModified() const
methods.
void showProgressInfo(bool)
method has been renamed to bool setProgressInfoEnabled(bool)
. The old name will
still work unless KDE_NO_COMPAT is defined.
KParts::BrowserExtension
The URLArgs urlArgs()
method is no more virtual. So when you want to
change the behavior of the urlArgs property you don't need to re-implement
both virtual functions, setURLArgs and urlArgs, but instead just re-implementing
setURLArgs does the job.
Changes in tdespell
KSpell
The API has been cleaned up to be in line with the rest of tdelibs, in particular:
Make sure to check if you use the above signals since your compiler
will typically not generate a compile-time error for these changes,
instead you might get a run-time error when you try to connect to
one of these signals using the old signature.
API-cleanups in TDEHTML
There were a few relatively minor API-adjustements in TDEHTMLPart. In particular:
Besides that, all methods previously marked as deprecated or were internal
but accidentally part of the public API are now private or removed.
As they were marked as becoming private already you should not experience
any problems. Backward compatibility exists for the common methods, to
disable this use a #define KDE_NO_COMPAT.
Changes in tdefile
The tdefile-library, as used by the KFileDialog provides classes for directory browsing widgets.
Those classes gained some new features, some parts were merged with other existing classes
and in some cases the API was cleaned up/fixed. The library is now built as part of libtdeio
library (there's no need to modify Makefiles which use $LIB_KFILE instead of hardcoding -ltdefile).
KFileItem
The KFileViewItem class is completely replaced with KFileItem from kio. All its functionality has
been merged with its former base class KFileItem. Additionally, some of its methods have been
modified:
Old: New: access() permissionsString() date() timeString() setViewItem( const KFileView *view, const void *item ) setExtraData( const void *key, void *value ) pixmap() The parameterless method has been removed, use pixmap( int size, int state = 0 ) instead. KFileReader
This class has been merged with KDirLister from kio.
KDirOperator
Old: New: saveConfig() writeConfig() setFileReader() setDirLister() fileReader() dirLister() activatedMenu( const KFileViewItem * ) activatedMenu( const KFileItem *, const TQPoint& pos ) KFileDetailView
The protected method setSortIndicator() has been removed, it's not needed anymore.
KFileView
This is the baseclass for all the views. It changed in many respects to allow for greater
flexibility and efficiency.
Sorting has changed radically. Previously, KFileView had protected methods QuickSort,
compareItems() and mergeLists() to sort directory entries for displaying in the views. Now,
KFileView does not do any sorting anymore. Instead, the view's (i.e. KIconView, KListView)
sorting is utilized by letting its view-items provide a TQString key() method. Therefore,
KFileView offers the two methods
which the view-classes can use to generate the string for the key() method. The KFile::SortMode
enum has been removed, as TQDir::SortSpec is used entirely.
Further changes:
Old: New: not existant virtual void readConfig( TDEConfig *, const TQString& group = TQString::null ) not existant void writeConfig( TDEConfig *, const TQString& group = TQString::null) virtual void setCurrentItem( const TQString& filename, KFileViewItem * ) Replaced with the two methods below. void setCurrentItem( const TQString& filename ); virtual void setCurrentItem( const KFileViewItem * ) = 0; setOperator( TQObject * ) setParentView( KFileView * ) virtual void insertSorted( KFileViewItem *, uint count ) virtual void insertItem( KFileItem * ) virtual void addItemList( const KFileViewItemList &list ) not virtual anymore. Sufficient to reimplement insertItem()
Three more pure virtual methods have been added:
Old: New: activateMenu( item ) sig->activateMenu( item, pos ) highlight( item ) sig->highlightFile( item ) select( item ) sig->select( item ) KFileViewSignaler
The methods activateDir( const KFileViewItem * ) and activateFile( const KFileViewItem * )
have been merged into the new method activate( const KFileItem * ).
Carsten Pfeiffer pfeiffer@kde.org
KIconDialog, KIconButton, KURLBar, KURLBarItem
Methods now use KIcon::Group and KIcon::Context instead of int as types for group and context arguments.
The change should affect only code using hardcoded numeric values instead of using the proper enum constants.
Changes in KControl
Modules that require root permission
The meaning of the X-TDE-RootOnly flag in the .desktop files has changed.
In KControl 2.0 a message was shown if the user did not press the "modify"
button. With the additional flag X-TDE-HasReadOnlyMode it was possible to show
a disabled version of the module instead of the message. The behavior was inconsistent
and has been changed:
For more details please consult the HOWTO file in the kcontrol directory.
Panel Applets and Extensions
KPanelApplet
KPanelExtension