Difference between revisions of "Development/Tutorials/Writing kontact plugins"

Jump to: navigation, search
m (tutorial for KDE 3)
(Writing a KPart)
Line 18: Line 18:
 
** use a Widget in it and use setWidget to get your widget into the KPart
 
** use a Widget in it and use setWidget to get your widget into the KPart
 
* write main.cpp
 
* write main.cpp
** create a KMainWindow* mw
+
** create a KParts::MainWindow* mw
 
** use new mypart(mw) to get your part into your main window
 
** use new mypart(mw) to get your part into your main window
  

Revision as of 17:57, 9 February 2008

Kontact plugins are KParts that get loaded at runtime. To integrate your KPart into kontact, you will need to have a .desktop file like this:

ls /home/kde-devel/kde/share/kde4/services/kontact/
akregatorplugin.desktop     knotesplugin.desktop
akregatorplugin3.2.desktop  korganizerplugin.desktop
journalplugin.desktop       newstickerplugin.desktop
kaddressbookplugin.desktop  plannerplugin.desktop
karmplugin.desktop          specialdatesplugin.desktop
kmailplugin.desktop         summaryplugin.desktop
kmobiletools.desktop        todoplugin.desktop
knodeplugin.desktop         weatherplugin.desktop

Writing a KPart

The following is what you do

  • write a subclass mypart of KParts::Part
    • use a Widget in it and use setWidget to get your widget into the KPart
  • write main.cpp
    • create a KParts::MainWindow* mw
    • use new mypart(mw) to get your part into your main window

See also


KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal