Archive:Development/Tutorials (zh TW): Difference between revisions

From KDE TechBase
No edit summary
No edit summary
Line 234: Line 234:
; [[Development/Tutorials/PolicyKit/KCM_HowTo|Getting root privileges in KCM Modules]]
; [[Development/Tutorials/PolicyKit/KCM_HowTo|Getting root privileges in KCM Modules]]
:''This tutorial will teach you how to create KCModules able to save settings as root''
:''This tutorial will teach you how to create KCModules able to save settings as root''
== Authorization and Privilege escalation (KAuth) ==
; [[Development/Tutorials/KAuth/KAuth_Basics|KAuth 基礎]]
:''An overview of concepts and basic knowledge required to understand and use KAuth effectively''
; [[Development/Tutorials/KAuth/KAuth_Actions|在您的程式使用 KAuth 動作]]
:''How to execute KAuth actions in your application, and how to integrate them tightly into your UI''
; [[Development/Tutorials/KAuth/Helper_HowTo|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''
; [[Development/Tutorials/PolicyKit/KCM_HowTo|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''


== 多媒體(Phonon)==
== 多媒體(Phonon)==
Line 345: Line 355:


;[http://developer.kde.org/language-bindings/ruby/kde3tutorial/index.html KDE Ruby Korundum 教學]
;[http://developer.kde.org/language-bindings/ruby/kde3tutorial/index.html KDE Ruby Korundum 教學]
:''A ruby version of Antonio Larrosa Jiménez's KDE tutorial by Richard Dale. See the [http://developer.kde.org/language-bindings/ruby/index.html Ruby Developers Corner] for Qt tutorials and other info.''
:''A ruby version of Antonio Larrosa Jiménez's KDE tutorial by Richard Dale. See the [[Development/Languages/Ruby (zh TW)|Ruby Developers Corner]] for Qt tutorials and other info.''


;[[Development/Tutorials/Qt4_Ruby_Tutorial_(zh_TW)|Qt4 Ruby 教學]]
;[[Development/Tutorials/Qt4_Ruby_Tutorial_(zh_TW)|Qt4 Ruby 教學]]
Line 421: Line 431:
:''本教學說明如何在我們的專案中使用 MarbleWidget''
:''本教學說明如何在我們的專案中使用 MarbleWidget''


===用本地 SCM 開發 KDE ===
===用本地 SCM 開發 KDE===
;[[Development/Tutorials/Git|使用 Git 在 KDE 開發]]
;[[Development/Tutorials/Git|使用 Git 在 KDE 開發]]
:''本教學說明如何使用 Git 在 KDE 開發''
:''本教學說明如何使用 Git 在 KDE 開發''


=== Kwin 效果教學(部落格)===
===Kwin 效果教學(部落格)===
;[http://blog.martin-graesslin.com/blog/?p=258 Martin Graesslin 的部落格]
;[http://blog.martin-graesslin.com/blog/?p=258 Martin Graesslin 的部落格]
:''This tutorial guides you through the development of a simple KWin effect''
:''This tutorial guides you through the development of a simple KWin effect''
Line 433: Line 443:
:''This tutorial shows how to write and KSysGuard sensor and connect it to the systray.''
:''This tutorial shows how to write and KSysGuard sensor and connect it to the systray.''
Runners
Runners
== KDE2 和 KDE3 材料 ==
== KDE2 和 KDE3 材料 ==
;[[Development/Tutorials/KDE3|KDE3 教學]]
;[[Development/Tutorials/KDE3|KDE3 教學]]
:''KDE3 相關主題的教學。''
:''KDE3 相關主題的教學。''

Revision as of 19:40, 11 February 2010

Template:I18n/Language Navigation Bar (zh TW)

教學是發現 KDE 能為你做哪些事以及如何做的捷徑。下面是當前可用的 KDE 4 教學列表。關於 KDE 3 和 KDE 2 的材料可以在本頁的底部找到。

KDE 4 程式設計介紹

你是否對用 KDE 4 寫程式感興趣呢?這個教學系列的目的是讓那些對 KDE 程式設計完全沒有概念的新手能夠入門。

Hello World
初步的介紹了 KDE 4 程式設計的最基本知識
建立主視窗
本教學將向你展示應用程式最重要的部分──主視窗──的魔術。
使用 KAction
如何在選單和工具列中加入動作(action)。
儲存與載入
介紹 KIO 函式庫,為我們的應用程式增加載入和儲存的功能。
命令列參數
加入在命令列用文字編輯器打開指定檔案的功能。

基礎知識

移植你的程式
協助移植應用程式從Qt3/KDE3到Qt4/KDE4
介紹 CMake
如何把 CMake 構建系統用於 KDE 4 。
常見程式設計錯誤
各種在開發 Qt 和 KDE 應用程式時常見的錯誤,以及如何避免它們。
使用 Qt Designer 建立使用者界面
如何使用 designer 建立 UI 檔案,以及如何整合它們到 KDE 程式中。
建立函式庫來分享程式碼
如何把函式庫加到建構系統以及如何準備原始碼。
工作階段管理
讓您的程式察覺 X 工作階段(X sessions)

測試與除錯

對你的應用程式進行除錯
對你的 KDE 應用程式進行除錯時可以採用的工具、技術和技巧。
使用 QTestLib 為 Q t4 與 KDE 4 編寫 Unittest原始出處
Brad Hards的教學,敘述如何使用 QTestLib 框架編寫 unit tests。它是一個基於例子的教學,仍在開發中。
檢測程式碼錯誤的半自動方法
一些您可以用在 KDE 程式碼中檢測錯誤的技術

使用 KConfig 管理配置資料

介紹 KConfig
概要介紹 KConfig 的類別,以及如何使用它們在你的應用程式的程式碼中
使用 KConfig XT
如何有效使用 KConfig XT 框架的教學。
更新 KConfig 檔案
如何編寫一個更新腳本,以保證你程式的設定檔格式與使用者已有的設定檔一致的教學

服務:應用程式和外掛

介紹服務框架
KDE中的服務框架,以及它們向開發人員提供了哪些功能的概述。覆蓋了系統配置快取(SyCoCa)、源資料檔案以及索引資訊可以做哪些事情。
使用 Trader Querie 來搜尋服務
如何使用 Trader Query 語法來搜尋那些在 SyCoCa 中有索引的服務,如外掛或者 mime 類型等
使用 KService 建立和載入模塊
學習如何使用 KService,以一種方便且易於擴展方式來完成定義自定外掛類型、搜尋已安裝的外掛(包括第三方外掛)、以及載入外掛等任務。

本地化

另見本地化入口

介紹 Unicode
介紹 Unicode 以及如何在 KDE 應用程式中處理 Unicode 資料。
編寫考慮到本地化需要的應用程式
這篇教學內容涵蓋了什麼是本地化、為什麼本地化很重要和如何確定您的應用程式已經為本地化做好準備。這是一份所有應用程式開發者都必讀的說明。
避免常見的本地化陷阱
這裡有許多常見易犯的錯誤,妨礙正確地本地化應用程式。這篇教學闡述了什麼是錯誤的方式,以及如何簡單地避開這些錯誤。
建構 KDE 的本地化模塊
對那些用 KDE 主要貯藏庫開發應用程式的人來說,建構和安裝 KDE 的本地化(l10n)模塊中的語言支援是一個好主意。這樣可以讓您在其他語言測試您的應用程式並且迅速發現什麼地方出問題了。本教學教導如何做到這一點。
合併 i18n 到建構系統中
一旦您的程式已準備好進行本地化工作,下一步是確保翻譯檔案是自動建立並且是不斷更新的。本教學涵蓋了必要加入的 CMakeFiles.txt 以及您的應用程式在發佈的過程中所產生的訊息記載。
常見的 i18n 挑戰和解決方案
本教學涵蓋你所可能遇到的各種挑戰,諸如陷入如翻譯手冊和存在原始碼以外的其他資料,合併和處理過時的 .po 檔,處理凍結,英語以外語言的編碼和建立獨立發佈版本或者在 KDE 模塊間轉移一些應用程式。
訊息的語義標記
為了讓應用程式中保持一貫的表述,並使得信息表述更有意義。使用KUIT系統,語義學標記可用於翻譯的信息標記。此教學說明本系統如何運作。
自動化 i18n 程式碼檢查
Krazy 程式碼檢查器會掃描 KDE 的程式碼並回報常見的 i18n 錯誤。

文件

API 文件
本教學解釋如何正確地文件化你的 API。
Man Pages
編寫和生成參考手冊。

應用程式自動化及腳本

D-Bus

介紹 D-Bus
A straight-forward introduction to the core concepts in D-Bus from an application developer's perspective, this tutorial covers what D-Bus is and how it can be used by applications.
訪問 D-Bus 介面
A step-by-step guide to calling D-Bus methods and connecting to D-Bus signals using QtDBus.
Intermediate D-Bus
Tips to make use of QtDBus when faced with problematic real-world interfaces.
建立 D-Bus 介面
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.
D-Bus 自動啟動服務
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.
從 DCOP 移植到 D-Bus
Port your applications from DCOP to D-Bus with this handy guide.

Konqueror

建立 Konqueror 服務選單
This tutorial shows you how to create mimetype-specific actions in Konqueror's context menu (aka "servicemenus").

Kross

介紹 Kross
介紹 Kross 腳本框架。
Hello World
使用 Kross 的第一個應用程式。
呼叫 Kross 中的函式
呼叫脚本函式的簡單示範
鏈接 Kross中的訊號(Signals)和槽(Slots)
簡單示範連接物件訊號和脚本的槽
Scripts as Plugins with Kross
This tutorial provides a step-by-step introduction how to integrate scripts as plugins into a KDE application.
加入腳本動作到程式選單
如何擴充您的程式選單來執行腳本檔案的簡單示範。

KOffice 外掛教學

KOffice 概觀
This document shows an overview of the different KOffice plugin types and tells you what each of their purpose and strengths are. If you are new with KOffice plugins, this is the place to start.
建立 KOffice Flake 外掛
This tutorial shows you how you can build a plugin for KOffice applications to allow you embed content in ODF documents using Flake.
KWord 腳本
本教學展示如何透過 Kross 使用Python、Ruby 或 JavaScript 腳本在 KWord。
KSpread 腳本
本教學展示如何透過 Kross 使用Python、Ruby 或 JavaScript 腳本在 KSpread。
Krita 腳本
本教學展示如何透過 Kross 使用Python、Ruby 或 JavaScript 腳本在 Krita。

SuperKaramba

SuperKaramba 教學
This tutorial provides an overview of SuperKaramba, theme files and scripting with Python, Ruby and JavaScript.

System Activity

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.

外掛和 KParts

撰寫 Kontact 外掛
Kontact 外掛是 KParts。本教學說明如何寫一個。
使用 KParts
學習如何載入 KPart 到應用程式視窗。
撰寫 Qt Designer 外掛
Add your widgets to Qt Designer and thus make them usable in UI files.

搜尋與元數據

Strigi

編寫檔案分析器
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.

Nepomuk

Nepomuk 快速入門
How to use Nepomuk resources in a quick and painless way without much fuss.
RDF and Ontologies in Nepomuk
An introduction to RDF and the usage of ontologies in Nepomuk.
Data Layout in Nepomuk
An overview of which and how data is stored in Nepomuk.
用 Nepomuk 處理資源
Nepomuk is the KDE library which provides easy access to metadata in the Nepomuk system. Learn how to make your application create and read metadata using the Nepomuk system.
使用 Nepomuk 資源生成器
Nepomuk includes a resource generator which creates convenience classes for handling metadata.
進階搜尋
The real power of Nepomuk can only be exposed when performing fancy queries on the data repository. This tutorial provides an introduction to semantic and full text queries in Nepomuk.
Nepomuk 伺服器和 Nepomuk 系統架構
The Nepomuk Server hosts the main Nepomuk data repository and can be accessed directly via a Soprano API.
Nepomuk 服務
The Nepomuk Server manages a set of Nepomuk services.
  • 存儲服務 The probably most important service hosts the Nepomuk data repository using Soprano.
  • Ontology Loader Makes sure installed ontologies such as RDF, RDFS, NRL, or Xesam are loaded into the storage repository.
  • 檔案監視服務 Monitors the file system for changes and updates the file resource paths and URIs in Nepomuk.
  • Strigi 服務 Controls Strigi, the file indexing tool which extracts metadata from files and stores it into the storage repository.
  • 查詢服務 Provides persistant query folders.
Nepomuk 提示和技巧
A set of tips and tricks for development with Nepomuk and Soprano. This is a must-read if you intend to use Nepomuk in your application or hack on it directly.

硬體探知(Solid)

介紹 Solid
An introduction to using the Solid hardware discovery and interaction system in KDE applications.
訪問網絡資訊
How to use the Solid system to get information about the network

特許應用程式(PolicyKit)

介紹 PolicyKit
A straight-forward introduction to what PolicyKit is, and how it can be useful for your next application requiring super-user privileges or user authentication
Using the caller-helper model to perform actions as root
This tutorial will teach you how to get your application to perform some actions as root in a completely safe and easy manner, if the user is authorized to, by using PolicyKit and the caller-helper technique
Getting root privileges in KCM Modules
This tutorial will teach you how to create KCModules able to save settings as root

Authorization and Privilege escalation (KAuth)

KAuth 基礎
An overview of concepts and basic knowledge required to understand and use KAuth effectively
在您的程式使用 KAuth 動作
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

多媒體(Phonon)

Phonon
如何入門多媒體 API
How to compile and use Phonon and its GStreamer backend on Linux using Qt 4.3.x
This article gives you a quick brief of how you can use checkout, compile Phonon and its GStreamer backend on GNU/Linux with just Qt 4.3.x. Towards the end, the article also describes how a developer can make use of Phonon to create simple audio and video players. You can read the article here. You can download the editable OpenDocumentText file from here.

Plasma

請見 Plasma 教學

通訊(Decibel)

Getting started with Decibel
This tutorial describes how to set up Decibel.
Handling TextChannels
This tutorial introduces the basics of handling incoming TextChannels by guiding you through building a simple text chat application.

個人資訊管理(Akonadi)

在應用程式中使用 Akonadi
Displaying and modifying data provided by Akonadi
開發 Akonadi 資源
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

Kate / Kwrite

KTextEditor 外掛入門
建立您第一個 KTextEditor 外掛
Developing a plugin with configuration dialog
Adding a configuration dialog to the Time & Date example
小型的編輯器
使用 KTextEditor 建立一個小程式

KDevelop

KDevelop-PG-Qt 介紹
Information on the KDevelop parser generator, useful for language plugins.

列印

Hello World
介紹 KDE 列印系統
列印對話框
使用 KDE 列印對話框

kioslaves

Collaboration

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
How to use KHotNewStuff3 in your application.
Introduction to Get Hot New Stuff 2
A short tutorial about how to use KHotNewStuff2 in your application. Deprecated, use version 3
  • old links for KNS1 content:
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]>.

Goya

Goya 使用簡介
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.
Goya 使用簡介(part 2)
The second part of the tutorial, with a slightly more complex example than the first part.

其他程式語言

Python

PyQt 介紹
Starting off
PyQt 範例
另一個 PyQt 介紹
PyKDE WebKit 教學
A simple web browser application in PyKDE
訊號(signals)與槽(slots)的101介紹
A simple introduction to Qt's signal and slot architecture.
PyKDE DBus 教學
An introduction to DBus communication using PyKDE

Ruby

KDE Ruby Korundum 教學
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 教學
Nokia 極佳的 Qt 入門教學,翻譯為 Ruby 版本。
用 Ruby 建立 Plasma Widget
本教學展示如何使用 Ruby 語言建立您的第一個 Plasma Applet。
在 Kubuntu 使用 Qt Designer 和 Ruby 開發 Qt4 應用程式
本教學從頭開始展示如何使用 Qt Designer 設計一個簡單的使用者介面,然後把產生的 widget 使用在 Qt Ruby 應用程式。
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

Shell Scripting with KDE dialogs原文鏈接
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 效能
Hints on avoiding common mistakes leading to poor performance when using QPainter

使用 KDE 遊戲函式庫

KStandardGameAction
使用 libkdegames 製作符合 kdegames 標準的遊戲
排行榜
實現一個簡單的排行榜表到你的遊戲
主题選擇器
Using the libkdegames theme selection dialog
Palapeli Patterns
Creating a pattern for Palapeli

KGLEngine

安裝和您的第一個 KGLItem
開始您的第一個 kglengine 應用程式
item motion
how to move kglitem
collision detection
how to detect collision and interact
texture and color
apply texture and color for your items
particles and shadow effects
add some nice effects
kglpong
Now use our knowledge to make a pong

KALEngine

播放 hello word 聲音
Using KALEngine for games sound development using openAL
Play music
Using KALEngine to play music in a stream

使用 KDE PIM 函式庫

iCalendar 功能
使用 kcal 管理 iCalendar 檔案

其它教學

2D Plotting(KPlotWidget)

使用 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).

拼寫與語法檢查(Sonnet)

在 KDE 應用程式中加入拼寫或語法檢查
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.

像素圖快取(KPixmapCache)

使用 KDE 像素圖快取
This tutorial shows how to use KPixmapCache to cache e.g. pixmaps generated from SVGs or some data.

使用 MarbleWidget(Marble)

使用 MarbleWidget
本教學說明如何在我們的專案中使用 MarbleWidget

用本地 SCM 開發 KDE

使用 Git 在 KDE 開發
本教學說明如何使用 Git 在 KDE 開發

Kwin 效果教學(部落格)

Martin Graesslin 的部落格
This tutorial guides you through the development of a simple KWin effect

實現並加入 KSysGuard 感應器

Development/Tutorials/Sensors
This tutorial shows how to write and KSysGuard sensor and connect it to the systray.

Runners

KDE2 和 KDE3 材料

KDE3 教學
KDE3 相關主題的教學。
KDE2 教學
KDE2 相關主題的教學。