- 1 KDE4编程基础
- 2 Testing And Debugging
- 3 Managing Configuration Data With KConfig
- 4 Services: Applications and Plugins
- 5 Localization
- 6 Documentation
- 7 Accessibility
- 8 Application Automation and Scripting
- 9 Plugins and KParts
- 10 Search and Metadata
- 11 Hardware Awareness (Solid)
- 12 Authorization and Privilege escalation (KAuth)
- 13 Multimedia (Phonon)
- 14 Plasma
- 15 Personal Information Management (Akonadi)
- 16 Kate / Kwrite
- 17 KDevelop
- 18 Printing
- 19 kioslaves
- 20 Collaboration
- 21 Goya
- 22 Other programming languages
- 23 Graphics Programming
- 24 Using the KDE Games Libraries
- 25 Using the KDE PIM Libraries
- 26 Other tutorials
- 26.1 2D Plotting (KPlotWidget)
- 26.2 Spelling and Grammar Checking (Sonnet)
- 26.3 Pixmap cache (KPixmapCache)
- 26.4 Using MarbleWidget (Marble)
- 26.5 Using local SCM for KDE development
- 26.6 Kwin effect tutorial (blog)
- 26.7 Implementing KSysGuard sensors and adding them
- 26.8 Porting an application from KSystemTrayIcon to KStatusNotifierItem
- 26.9 Using the KDE Wallet API for safe storage
- 26.10 How to edit a wiki with Libmediawiki
- 27 KDE2 and KDE3 Materials
- Using SqLite databases and QtSql
- Integrated databases without the need for a database server
- How to understand and debug errors from the linker, at compile time.
- Using Qt Creator to develop your KDE program
- How to use Qt Creator as an IDE to develop KDE programs
- Creating Libraries to share code
- How to add the library to the buildsystem and how to prepare the source code.
- Session Management
- Make your application aware of X sessions
- Deliver your application with icons that are automatically installed to the right places. Based on the Kaction Tutorial.
- Desktop File
- Let your application show up in the K menu and in application menus. Based on the Icons Tutorial.
- Building an Existing KDE Application
If you want to improve an existing application, you can usually build and install it easily. This tutorial shows how to build an application in a way that doesn't interfere with your system. If you do not need to modify kdelibs this may be the easiest way to get started with development.
Testing And Debugging
- Debugging your application
- Tips, tools and techniques to apply when debugging your KDE application
- Writing Unittests for Qt4 and KDE4 with QTestLib (Original link)
- Tutorial by Brad Hards that describes how to write unit tests using the QTestLib framework. It is presented as an example based tutorial, and is still under development.
- Semi-automatic ways to detect code errors
- Techniques you can use to detect errors in KDE code
Managing Configuration Data With KConfig
- Introduction To KConfig
- An overview of the KConfig classes and how to use them in your application code
- Using KConfig XT
- Tutorial on how to efficiently use the KConfig XT framework.
- Updating KConfig Files
- Tutorial on how to write an update script to keep changes in your application's config file format in sync with the user's already existing config file
Services: Applications and Plugins
- Introduction to the Services Framework
- An overview of the services framework in KDE and what it provides the application developer. Covers the system configuration cache (SyCoCa), the source data files and what the indexed information can be used for.
- Finding Services Using Trader Queries
- How to find services, such as plugins or mimetypes, that are indexed in the SyCoCa using Trader Query Syntax
- Creating and Loading Plugins Using KService
- Learn how to define custom plugin types, find installed plugins (including 3rd party plugins) and load them in an easy and portable fashion using KService.
See also Localization portal.
- Introduction To Unicode
- An introduction to what Unicode is as well as how to handle Unicode data in KDE applications.
- Writing Applications With Localization In Mind
- This tutorial covers what localization is, why it's important and how to ensure your application is ready to be localized. A must read for all application developers.
- Avoiding Common Localization Pitfalls
- There are several common mistakes that prevent applications from being properly localized. Find out what they are and how to easily avoid them in this tutorial.
- Building KDE's Localization Module
- Building and installing language support from KDE's localization (l10n) module is a good idea for those working on applications in the main KDE repository. Doing so will allow you to test your application in another language and spot problem areas. Learn how to do just that in this tutorial.
- Incorporating i18n Into the Build System
- Once your application is ready to be localized, the next step is to ensure that translation files are built automatically and kept up to date. This tutorial covers the necessary CMakeFiles.txt additions as well the process of distributing the resulting message catalogs with your application.
- Common i18n Challenges and Solutions
- This tutorial covers challenges that you may eventually run into such as translating handbooks and other data that exists outside of the source code, merging and handling obsolete .po files, dealing with freezes, coding in languages other than English and creating independent releases of or moving applications between KDE modules.
- Semantic Markup of Messages
- To ensure consistent presentation and more meaningful representations of messages in applications, semantic markup can be applied to messages marked for translation using the KUIT system. This tutorial describes how this system works.
- Automated i18n Code Checking
- The Krazy code checker scans KDE's code and reports common i18n mistakes.
- API Documentation
- This tutorial explains how to document your APIs properly.
- Man Pages
- Writing and Generating Reference Manual Pages.
- Source Code
- Accessibility Overview
- A list of accessibility tutorials and general information.
- Accessibility Checklist
- What to look for in your application to make it accessible for as many people as possible.
- Screen Reader
- This tutorial will explain some details about using screen readers with KDE applications.
- How to utilize Jovie text-to-speech service in your application.
Application Automation and Scripting
- D-Bus 介绍
- Tips to make use of QtDBus when faced with problematic real-world interfaces.
- Creating D-Bus Interfaces
- Learn how to expose functionality in your application by creating and using custom D-Bus interfaces. Covers generating the XML descriptions, instantiating interfaces at run time and setting up the build system with CMake.
- Using Custom Types with D-Bus
- Learn how to use your own types in classes exported on D-Bus. Covers marhaling and unmarshaling of objects, the integration of custom types into XML descriptions and registering the custom types with the Qt Meta Object system.
- D-Bus Autostart Services
- Turn your application into a D-Bus autostart service with this tutorial. This D-Bus feature, also known as "D-Bus service activation", will ensure that even when your application isn't running that D-Bus calls made to it will work by relying on the D-Bus daemon itself to start your app if and when needed.
- Porting from DCOP to D-Bus
- Port your applications from DCOP to D-Bus with this handy guide.
- Creating Konqueror Service Menus
- This tutorial shows you how to create mimetype-specific actions in Konqueror's context menu (aka "servicemenus").
- Introduction to Kross
- An introduction to the Kross Scripting Framework.
- Hello World
- A first application with working kross code.
- Calling Functions in Kross
- Simple demonstration of calling scripting functions
- Connecting Signals and Slots in Kross
- Simple demonstration of connecting object signals with script slots
- Scripts as Plugins with Kross
- This tutorial provides a step-by-step introduction how to integrate scripts as plugins into a KDE application.
- Placing script actions in your application menus
- Simple demonstration on how to extend you application menus to execute script files.
- How to use an ActionCollection
- A small Tutorial on How to use Kross::ActionCollections.
- REDIRECT Projects/Calligra/Plugin Tutorials
- SuperKaramba Tutorial
- Writing script actions for the process's context menu
- This tutorial shows how to add a context menu action to show custom information about a process.
- KWin Scripting Tutorial
- This tutorial shows how to write a useful script for KWin.
- QML Window Switcher Layouts
- This tutorial documents the new QML layouts for the KWin Window Switcher
Plugins and KParts
- Using KParts
- A kPart is a plugin that you can just load into your application. For example, it is easy to integrate an editor (the katePart) or a console (the konsolePart) into your application's window.
- Writing kontact plugins
- Kontact plugins are KParts. This tutorial describes how you can write one.
- Writing Qt Designer Plugins
- Add your widgets to Qt Designer and thus make them usable in UI files.
- KCM HowTo
- KCM are plugins which are loaded by System Settings to display configuration elements. They can also be used within an application.
Search and Metadata
- Writing file analyzers
- File analyzers extract data from files to display in the file dialogs and file managers. The data gathered this way is also used to search for files. KDE4 allows the use of multiple analyzers per file type. This tutorial describes how you can write new analyzers.
See Nepomuk tutorials.
Hardware Awareness (Solid)
- Introduction to Solid
- An introduction to the Solid effort in general and it library in particular.
- Listing Devices
- How to use the Solid core library to discover the hardware and interact with the system.
- Accessing Network Information
- How to use the Solid system to get information about the network
- Creating a Device Action
- When your application is interested in registering actions with the system for removable hardware
Authorization and Privilege escalation (KAuth)
- KAuth Basics
- An overview of concepts and basic knowledge required to understand and use KAuth effectively
- Using KAuth actions in your application
- How to execute KAuth actions in your application, and how to integrate them tightly into your UI
- Creating a KAuth helper to perform a privileged action
- You will learn how to use KAuth's helpers and escalation facilities, and how to seamlessly make a privileged and non privileged portion of your application interact
- Creating a KCM requiring authorization upon saving
- Learn how to use the high level KCModule API to create KCModules handling authorization, and its UI integration, on their own
- The ;Introduction to Phonon tells how to compile and run the code. If you like to work in Python, try this version of the same tutorial
- Writing Backends
- How to start creating a new backend for the multimedia API
- Please have a look at the online documentation for information on the Phonon API. If you prefer using Qt Assistant or Qt Creator you can also use our offline documentation.
See Plasma tutorials.
Personal Information Management (Akonadi)
- Using Akonadi in Applications
- Displaying and modifying data provided by Akonadi
- Developing Akonadi Resources
- Akonadi Resources are agent programs which transport PIM data between Akonadi and a backend (files, servers, etc)
- Using custom data types with Akonadi
- Akonadi can handle arbitrary data as item payloads through the use of a plugin based serialization framework
- Porting Applications which use KResource API
- Applications using KDE's now deprecated KResource APIs, e.g. KABC or KCal, need to be ported to use their Akonadi equivalents
Kate / Kwrite
- Getting started with KTextEditor plugins
- Creating your first KTextEditor plugin
- Developing a plugin with configuration dialog
- Adding a configuration dialog to the Time & Date example
- A small Editor
- Create a small application using KTextEditor
- KDevelop-PG-Qt Introduction
- Information on the KDevelop parser generator, useful for language plugins.
KDE mostly uses the Qt Printing infrastructure.
- Hello World
- Introduction to the KDE printing system
Open Collaboration Services (libattica)
- Introduction to Attica
- In this tutorial a simple widget showing information about a Person on the server is created.
Get Hot New Stuff
- Get Hot New Stuff 3 - Download
- How to use KHotNewStuff3 in your application.
- Get Hot New Stuff 3 - Checking for Updates
- How to check whether updates for installed stuff are available without showing the dialog/widget.
- Get Hot New Stuff 3 - Upload
- How to add an upload dialog to your application.
Old links for KNS2 and KNS1 content:
- Introduction to Get Hot New Stuff 2
- A short tutorial about how to use KHotNewStuff2 in your application. Deprecated, use version 3
- Introduction to Get Hot New Stuff
- An introduction to the developer-friendly network update system that allows KDE applications to fetch new application data at runtime in a user friendly manner.
- KNewStuff Secure (Original Link)
- Tutorial showing how to share resources in a secured way (KDE 3.4 and later). By András Mantia <[email protected]>.
- Introduction to Goya usage
- An introduction for the Goya subsystem usage, which allows you to easily add widgets to your itemviews and connect their signals to your code, as they were real widgets.
- Introduction to Goya usage (part 2)
- The second part of the tutorial, with a slightly more complex example than the first part.
Other programming languages
- An Introduction to PyQt
- Starting off
- PyQt by Example
- Another introduction to PyQt
- PyKDE WebKit Tutorial
- A simple web browser application in PyKDE
- 101 Introduction to signals and slots
- A simple introduction to Qt's signal and slot architecture.
- PyKDE DBus Tutorial
- An introduction to DBus communication using PyKDE
- PyKDE KNotify Tutorial
- An introduction to Knotify (Notifications and KJobs) using PyKDE
- KDE Ruby Korundum tutorial
- A ruby version of Antonio Larrosa Jiménez's KDE tutorial by Richard Dale. See the Ruby Developers Corner for Qt tutorials and other info.
- Qt4 Ruby Tutorial
- Nokia's fabulous introductory tutorial to Qt, translated to Ruby.
- Creating a Plasma Widget in Ruby
- Tutorial that shows how to create your first Plasma Applet using the Ruby language.
- Developing Qt4 Applications using Qt Designer and Ruby on Kubuntu
- Tutorial that shows how to design a simple User Interface in Qt Designer and then use the resulting widget in a Qt Ruby application we build from scratch.
- Ruby-Qt/KDE Book
- There is also an approach to create an Ruby-Qt/KDE Book under a free license. The content will be created in this wiki.
- Shell Scripting with KDE dialogs (Original Link)
- Tutorial by Brad Hards that describes how to use KDE dialogs in shell scripts with kdialog. It is presented as an example based tutorial.
- QPainter Perfomance
- Hints on avoiding common mistakes leading to poor performance when using QPainter
Using the KDE Games Libraries
- Using libkdegames to make your game fit the kdegames standard
- Implementing a simple highscore table into your game
- Theme Selector
- Using the libkdegames theme selection dialog
- Palapeli Slicers
- Creating a slicer plugin for Palapeli
- Installation and your first KGLItem
- start your first kglengine application
- Now use our knowledge to make a pong
Using the KDE PIM Libraries
- iCalendar functionality
- Using kcal to manage iCalendar files
2D Plotting (KPlotWidget)
- Using the KDE data-plotting widget
- This tutorial introduces KPlotWidget, which is used for 2-D data plotting. It includes information on simple usage of the widget (including adding and modifying data sets, and customizing the plot axes and labels), and advanced customization (including extending the widget through sub-classing).
Spelling and Grammar Checking (Sonnet)
- Adding spell-checking or grammar-checking to KDE applications
- This tutorial introduces Sonnet and how one may use it to add language correction to your KDE application. Sonnet's auxiliary features shall be described in a separate tutorial.
Pixmap cache (KPixmapCache)
- Using the KDE pixmap cache
- This tutorial shows how to use KPixmapCache to cache e.g. pixmaps generated from SVGs or some data.
Using MarbleWidget (Marble)
- Using MarbleWidget
- This short tutorial describes how to use the MarbleWidget in your project
Using local SCM for KDE development
- Using Git to develop for KDE
- Here you find how to use Git to develop for KDE
Kwin effect tutorial (blog)
- blog by Martin Graesslin
- This tutorial guides you through the development of a simple KWin effect
Implementing KSysGuard sensors and adding them
- Sensors Tutorial
- This tutorial shows how to write and KSysGuard sensor and connect it to the systray.
Porting an application from KSystemTrayIcon to KStatusNotifierItem
- Porting from KSystemTrayIcon to KStatusNotifierItem
- This tutorials shows how to port an application using KSystemTrayIcon to KStatusNotifierItem
Using the KDE Wallet API for safe storage
- "Brief introduction to the KWallet API which can be used for storing all kinds of sensitive information."
How to edit a wiki with Libmediawiki
- This tutorial present how to edit a wiki with Libmediawiki.