Commit da8b148d authored by Tobias Fella's avatar Tobias Fella
Browse files

Port api links to the new link syntax

parent 165d8070
{"kdeclarative": {"url": "https://api.kde.org/frameworks/kdeclarative/html/"}, "ki18n": {"url": "https://api.kde.org/frameworks/ki18n/html/"}, "kcoreaddons": {"url": "https://api.kde.org/frameworks/kcoreaddons/html/"}, "kio": {"url": "https://api.kde.org/frameworks/kio/html/"}, "kxmlgui": {"url": "https://api.kde.org/frameworks/kXmlGui/html/"}, "kconfigwidgets": {"url": "https://api.kde.org/frameworks/kconfigwidgets/html/"}, "kwidgetsaddons": {"url": "https://api.kde.org/frameworks/kwidgetsaddons/html/"}, "kirigami2": {"url": "https://api.kde.org/frameworks/kirigami/html/", "default_prefix": "org::kde::kirigami::"}, "qtquickcontrols": {"url": "https://doc.qt.io/qt-5/"}}
\ No newline at end of file
{"kdeclarative": {"url": "https://api.kde.org/frameworks/kdeclarative/html/"}, "ki18n": {"url": "https://api.kde.org/frameworks/ki18n/html/"}, "kcoreaddons": {"url": "https://api.kde.org/frameworks/kcoreaddons/html/"}, "kio": {"url": "https://api.kde.org/frameworks/kio/html/"}, "kxmlgui": {"url": "https://api.kde.org/frameworks/kxmlgui/html/"}, "kconfigwidgets": {"url": "https://api.kde.org/frameworks/kconfigwidgets/html/"}, "kwidgetsaddons": {"url": "https://api.kde.org/frameworks/kwidgetsaddons/html/"}, "ktexteditor": {"url": "https://api.kde.org/frameworks/ktexteditor/html/"}, "kconfig": {"url": "https://api.kde.org/frameworks/kconfig/html/"}, "plasma": {"url": "https://api.kde.org/frameworks/plasma-framework/html/"}, "kdecoration2": {"url": "https://api.kde.org/kdecoration/html/"}, "kirigami2": {"url": "https://api.kde.org/frameworks/kirigami/html/", "default_prefix": "org::kde::kirigami::"}, "qtquickcontrols": {"url": "https://doc.qt.io/qt-5/"}}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -21,7 +21,7 @@ Values stored may be of any number of data types. They are stored and retrieved
### The KConfig Class
The {{< api-link module="kconfig" link="KConfig" >}} object is used to access a given configuration object. There are a number of ways to create a config object:
The [KConfig](docs:kconfig;KConfig) object is used to access a given configuration object. There are a number of ways to create a config object:
{{< highlight cpp >}}
// a plain old read/write config object
......@@ -55,7 +55,7 @@ Finally on line 18 we see the creation of a configuration object that does not e
### Special Configuration Objects
Each application has its own configuration object that uses the name provided to {{< api-link module="kcoreaddons" link="KAboutData" >}} appended with "rc" as its name. So an app named "myapp" would have the default configuration object of "myapprc" (located in $HOME/.config/). This configuration file can be retrieved in this way:
Each application has its own configuration object that uses the name provided to [KAboutData](docs:kcoreaddons;KAboutData) appended with "rc" as its name. So an app named "myapp" would have the default configuration object of "myapprc" (located in $HOME/.config/). This configuration file can be retrieved in this way:
```cpp
#include <KComponentData>
......@@ -103,9 +103,9 @@ for (const QString &group: config->groupList()) {
## KSharedConfig
The {{< api-link module="kconfig" link="KSharedConfig" >}} class is a reference counted pointer to a {{< api-link module="kconfig" link="KConfig" >}}. It thus provides a way to reference the same configuration object from multiple places in your application without the extra overhead of separate objects or concerns about synchronizing writes to disk even if the configuration object is updated from multiple code paths.
The [KSharedConfig](docs:kconfig;KSharedConfig) class is a reference counted pointer to a [KConfig](docs:kconfig;KConfig). It thus provides a way to reference the same configuration object from multiple places in your application without the extra overhead of separate objects or concerns about synchronizing writes to disk even if the configuration object is updated from multiple code paths.
Accessing a {{< api-link module="kconfig" link="KSharedConfig" >}} object is as easy as this:
Accessing a [KSharedConfig](docs:kconfig;KSharedConfig) object is as easy as this:
```cpp
KSharedConfigPtr config = KSharedConfig::openConfig("ksomefilerc");
......@@ -125,7 +125,7 @@ KConfigGroup generalGroup(&config, "General");
KConfigGroup colorsGroup = config.group("Colors"); // ... or a bit differently ...
```
You can pass {{< api-link module="kconfig" link="KConfig" >}} or {{< api-link module="kconfig" link="KSharedConfig" >}} objects to {{< api-link module="kconfig" link="KConfigGroup" >}}.
You can pass [KConfig](docs:kconfig;KConfig) or [KSharedConfig](docs:kconfig;KSharedConfig) objects to [KConfigGroup](docs:kconfig;KConfigGroup).
Config groups can be nested as well:
......@@ -136,7 +136,7 @@ KConfigGroup subGroup2 = colorsGroup.group("Dialogs");
## Reading Entries
With a {{< api-link module="kconfig" link="KConfigGroup" >}} object in hand reading entries is now quite straight forward:
With a [KConfigGroup](docs:kconfig;KConfigGroup) object in hand reading entries is now quite straight forward:
```cpp
QString accountName = generalGroup.readEntry("Account", QString());
......@@ -168,7 +168,7 @@ Note the use of `writePathEntry` and how the type of object we use, such as [QCo
When is a configuration file not a configuration file? When it is a [desktop](http://freedesktop.org/wiki/Specifications/desktop-entry-spec) file. These files, which are essentially configuration files at their heart, are used to describe entries for application menus, mimetypes, plugins and various services.
When accessing a .desktop file, one should instead use the {{< api-link module="kconfig" link="KDesktopFile" >}} class which, while a {{< api-link module="kconfig" link="KConfig" >}} class offering all the capabilities described above, offers a set of methods designed to make accessing standard attributes of these files consistent and reliable.
When accessing a .desktop file, one should instead use the [KDesktopFile](docs:kconfig;KDesktopFile) class which, while a [KConfig](docs:kconfig;KConfig) class offering all the capabilities described above, offers a set of methods designed to make accessing standard attributes of these files consistent and reliable.
## Kiosk: Lockdown and User/Group Profiles
......
......@@ -38,9 +38,9 @@ The basic structure of a hypothetical time settings module is the following:
{{< readfile file="/content/docs/configuration/kcm/timesettings.h" highlight="cpp" >}}
[`KQuickAddons::ConfigModule`](https://api.kde.org/frameworks/kdeclarative/html/classKQuickAddons_1_1ConfigModule.html)
[KQuickAddons::ConfigModule](docs:kdeclarative;KQuickAddons::ConfigModule)
serves as the base class for all QML-based KCMs. The
[`KQuickAddons::ManagedConfigModule`](https://api.kde.org/frameworks/kdeclarative/html/classKQuickAddons_1_1ManagedConfigModule.html) inherits `ConfigModule` and adds the [KConfigXt](kconfig_xt) integration.
[KQuickAddons::ManagedConfigModule](docs:kdeclarative;KQuickAddons::ManagedConfigModule) inherits `ConfigModule` and adds the [KConfigXt](kconfig_xt) integration.
Please consult the API documentation for a full description.
## timesettings.cpp
......@@ -69,9 +69,9 @@ Basic KCM QML file
Depending on the content use one of the following root type:
- Use {{< api-link module="kdeclarative" link="org::kde::kcm::ScrollViewKCM" name="ScrollViewK" >}} for content that is vertically scrollable, such as ListView.
- Use {{< api-link module="kdeclarative" link="org::kde::kcm::GridViewKCM" name="GridViewKCM" >}} for arranging selectable items in a grid.
- Use {{< api-link module="kdeclarative" link="org::kde::kcm::SimpleKCM" name="SimpleKCM" >}} otherwise.
- Use [ScrollViewKCM](docs:kdeclarative;org::kde::kcm::ScrollViewKCM) for content that is vertically scrollable, such as ListView.
- Use [GridViewKCM](docs:kdeclarative;org::kde::kcm::GridViewKCM) for arranging selectable items in a grid.
- Use [SimpleKCM](docs:kdeclarative;org::kde::kcm::SimpleKCM) otherwise.
## Run it!
......
......@@ -148,11 +148,11 @@ the generation of the yourconfigclassname.{h,cpp} files where your configuration
reside.
There are additional optional entries, which your application might need. The full list is
available on the [kconfig_compiler](https://api.kde.org/frameworks/kconfig/html/kconfig_compiler.html).
available on the [kconfig_compiler](docs:kconfig;kconfig_compiler.html).
{{< alert title="Note" color="info" >}}
You can find more information about all the available options in the
[kconfig_compiler documentation](https://api.kde.org/frameworks/kconfig/html/kconfig_compiler.html).
[kconfig_compiler documentation](docs:kconfig;kconfig_compiler.html).
{{< /alert >}}
## Adjusting the CMakeLists.txt file
......
......@@ -203,4 +203,4 @@ to know that they exist.
| X-KDE-MinNumberOfUrls | Minimum number of Urls that can be selected in order for this menu to be displayed. This property is available since version 5.76 |
| X-KDE-MaxNumberOfUrls | Maximum number of Urls that can be selected in order for this menu to be displayed. This property is available since version 5.76 |
If you need more dynamic options please check out {{< api-link module="kio" link="KAbstractFileItemActionPlugin" >}} on how to write such plugins in C++.
If you need more dynamic options please check out [KAbstractFileItemActionPlugin](docs:kio;KAbstractFileItemActionPlugin) on how to write such plugins in C++.
......@@ -8,7 +8,7 @@ group: "getting-started"
---
This tutorial will guide you in creating a small text editor using
[KTextEditor](https://api.kde.org/frameworks/ktexteditor/html/index.html)
, [KXmlGui](https://api.kde.org/frameworks/kxmlgui/html/index.html) for
the window and [KIO](https://api.kde.org/frameworks/kio/html/index.html)
[KTextEditor](docs:ktexteditor;index.html)
, [KXmlGui](docs:kxmlgui;index.html) for
the window and [KIO](docs:kio;index.html)
for saving and loading files.
......@@ -23,15 +23,15 @@ All the code we need will be in one file, `main.cpp`. Create that file with the
{{< readfile file="/content/docs/getting-started/hello_world/main.cpp" highlight="cpp" >}}
First we need to create a [QApplication](https://doc.qt.io/qt-5/qapplication.html) object. This needs to be done exactly once in each program since it is needed for things such as [Internationalization](../i18n/). It also should be created before any other KDE Framework or Qt object. A call to {{< api-link module="ki18n" link="KLocalizedString::setApplicationDomain" >}} is required to properly set the translation catalog and must be done before the next step happens.
First we need to create a [QApplication](https://doc.qt.io/qt-5/qapplication.html) object. This needs to be done exactly once in each program since it is needed for things such as [Internationalization](../i18n/). It also should be created before any other KDE Framework or Qt object. A call to [KLocalizedString::setApplicationDomain](docs:ki18n;KLocalizedString::setApplicationDomain) is required to properly set the translation catalog and must be done before the next step happens.
The first KDE Framework specific object we create in this program is {{< api-link module="kcoreaddons" link="KAboutData" >}}. This is the class used to store information about the program such as a short description, authors or license information. Pretty much every KDE application should use this class. We then call {{< api-link module="kcoreaddons" link="KAboutData::setApplicationData" >}} to initialize the properties of the [QApplication ](https://doc.qt.io/qt-5/qapplication.html) object.
The first KDE Framework specific object we create in this program is [KAboutData](docs:kcoreaddons;KAboutData). This is the class used to store information about the program such as a short description, authors or license information. Pretty much every KDE application should use this class. We then call [KAboutData::setApplicationData](docs:kcoreaddons;KAboutData::setApplicationData) to initialize the properties of the [QApplication ](https://doc.qt.io/qt-5/qapplication.html) object.
Then we come to [QCommandLineParser ](https://doc.qt.io/qt-5/qcommandlineparser.html). This is the class one would use to specify command line switches to, for example, open the program with a specific file. However, in this tutorial, we simply initialise it with the {{< api-link module="kcoreaddons" link="KAboutData" >}} object we created so we can use the --version or --author switches.
Then we come to [QCommandLineParser ](https://doc.qt.io/qt-5/qcommandlineparser.html). This is the class one would use to specify command line switches to, for example, open the program with a specific file. However, in this tutorial, we simply initialise it with the [KAboutData](docs:kcoreaddons;KAboutData) object we created so we can use the --version or --author switches.
Now we've done all the necessary setup, we can move on to doing interesting things with our application. We're going to create a popup box but we're going to customise one of the buttons. To do this customisation, we need to use a {{< api-link module="kwidgetsaddons" link="KGuiItem" >}} object. The first argument in the {{< api-link module="kwidgetsaddons" link="KGuiItem" >}} constructor is the text that will appear on the item (in our case, a button). Then we have an option of setting an icon for the button but we don't want one so we just give it `QString()`. We then set the tooltip (what appears when you hover over an item) and finally the "What's This?" (accessed through right-clicking or Shift-F1) text.
Now we've done all the necessary setup, we can move on to doing interesting things with our application. We're going to create a popup box but we're going to customise one of the buttons. To do this customisation, we need to use a [KGuiItem](docs:kwidgetsaddons;KGuiItem) object. The first argument in the [KGuiItem](docs:kwidgetsaddons;KGuiItem) constructor is the text that will appear on the item (in our case, a button). Then we have an option of setting an icon for the button but we don't want one so we just give it `QString()`. We then set the tooltip (what appears when you hover over an item) and finally the "What's This?" (accessed through right-clicking or Shift-F1) text.
Now we have our item, we can create our popup. We call the {{< api-link module="kwidgetsaddons" link="KMessageBox::questionYesNo" >}} function which, by default, creates a message box with a "Yes" and a "No" button. The second argument is the text that will appear in the message box above the buttons. The third is the caption the window will have and finally, we set the KGuiItem for (what would normally be) the "Yes" button to the KGuiItem yesButton we created.
Now we have our item, we can create our popup. We call the [KMessageBox::questionYesNo](docs:kwidgetsaddons;KMessageBox::questionYesNo) function which, by default, creates a message box with a "Yes" and a "No" button. The second argument is the text that will appear in the message box above the buttons. The third is the caption the window will have and finally, we set the KGuiItem for (what would normally be) the "Yes" button to the KGuiItem yesButton we created.
Note that all user-visible text is passed through the `i18n()` function; this is necessary for the UI to be translatable. More information on internalization can be found in the :doc:`../i18n/index` tutorial.
......@@ -58,7 +58,7 @@ Then we use `add_executable()` to create an executable called `helloworld` from
Make And Run
------------
To compile, link and install your program, you must have several software installed, e.g. cmake, make and gcc-c++, and the Qt 5 and KDE Frameworks development files. To be sure you have everything, best follow [this install guide ](https://community.kde.org/Get_Involved/development#One-time_setup:_your_development_environment).
To compile, link and install your program, you must have several software installed, e.g. cmake, make and gcc-c++, and the Qt 5 and KDE Frameworks development files. To be sure you have everything, best follow [this install guide](https://community.kde.org/Get_Involved/development#One-time_setup:_your_development_environment).
While you can run **CMake** directly inside the source code directory itself, it is a best practice, and actually enforced in some KDE software, to use a separate build directory and run **CMake** from there:
......
......@@ -7,7 +7,7 @@ description: >
## Summary
This tutorial carries on from [First Program Tutorial](../hello_world) and will introduce the {{< api-link module="kxmlgui" link="KXmlGuiWindow" >}} class.
This tutorial carries on from [First Program Tutorial](../hello_world) and will introduce the [KXmlGuiWindow](docs:kxmlgui;KXmlGuiWindow) class.
In the previous tutorial, the program caused a dialog box to pop up but we're going to take steps towards a functioning application.
......@@ -15,7 +15,7 @@ In the previous tutorial, the program caused a dialog box to pop up but we're go
## KXmlGuiWindow
{{< api-link module="kxmlgui" link="KXmlGuiWindow" >}} provides a full main window view with menubars, toolbars, a statusbar and a main area in the centre for a large widget. For example, the help-menu is predefined. Most KDE applications will derive from this class as it provides an easy way to define menu and toolbar layouts through XML files (this technology is called XMLGUI and is part of the KF5::XmlGui framework). While we will not be using XMLGUI in this tutorial, we will use it in the next.
[KXmlGuiWindow](docs:kxmlgui;KXmlGuiWindow) provides a full main window view with menubars, toolbars, a statusbar and a main area in the centre for a large widget. For example, the help-menu is predefined. Most KDE applications will derive from this class as it provides an easy way to define menu and toolbar layouts through XML files (this technology is called XMLGUI and is part of the KF5::XmlGui framework). While we will not be using XMLGUI in this tutorial, we will use it in the next.
In order to have a useful KXmlGuiWindow, we must subclass it. So we create two files, a `mainwindow.cpp` and a `mainwindow.h` which will contain our code.
......@@ -36,7 +36,7 @@ First, of course, we have to include the header file containing the class declar
We initialise our text editor with an object and use KXmlGuiWindow's built-in `setCentralWidget()` function on it which tells the KXmlGuiWindow what should appear in the central section of the window.
Finally, {{< api-link module="kxmlgui" link="KXmlGuiWindow::setupGUI" >}} is called which does a lot of behind-the-scenes stuff and creates the default menu bars (Settings, Help).
Finally, [KXmlGuiWindow::setupGUI](docs:kxmlgui;KXmlGuiWindow::setupGUI) is called which does a lot of behind-the-scenes stuff and creates the default menu bars (Settings, Help).
### Back to main.cpp
......
......@@ -23,9 +23,9 @@ Nothing changed here.
{{< readfile file="/content/docs/getting-started/saving_and_loading/mainwindow.h" highlight="cpp" >}}
Since we want to add the ability to load and save files, we must add the functions which will do the work. Since the functions will be called through [Qt's signal/slot ](http://doc.qt.io/qt-5/signalsandslots.html) mechanism we must specify that these functions are slots. Since we are using slots in this header file, we must also add the [Q_OBJECT ](http://doc.qt.io/qt-5/qobject.html#Q_OBJECT) macro.
Since we want to add the ability to load and save files, we must add the functions which will do the work. Since the functions will be called through [Qt's signal/slot](http://doc.qt.io/qt-5/signalsandslots.html) mechanism we must specify that these functions are slots. Since we are using slots in this header file, we must also add the [Q_OBJECT](http://doc.qt.io/qt-5/qobject.html#Q_OBJECT) macro.
We also want to keep track of the filename of the currently opened file so we declare a [QString ](https://doc.qt.io/qt-5/qstring.html) `fileName`.
We also want to keep track of the filename of the currently opened file so we declare a [QString](https://doc.qt.io/qt-5/qstring.html) `fileName`.
### mainwindow.cpp
......@@ -35,7 +35,7 @@ We'll get into the details of mainwindow.cpp in a while.
### savingloadingui.rc
This is identical to usingactionsui.rc from the [previous tutorial](../using_actions) except the name has changed to 'savingloading'. We do not need to add any information about any of the {{< api-link module="kconfigwidgets" link="KStandardAction" >}} since the placement of those actions is handled automatically by XMLGUI system.
This is identical to usingactionsui.rc from the [previous tutorial](../using_actions) except the name has changed to 'savingloading'. We do not need to add any information about any of the [KStandardAction](docs:kconfigwidgets;KStandardAction) since the placement of those actions is handled automatically by XMLGUI system.
## Explanation
......@@ -45,7 +45,7 @@ The first thing we do is add `fileName(QString())` to the MainWindow constructor
### Adding the actions
The first thing we are going to do is provide the outward interface for the user so they can tell the application to load and save. Like with the quit action in [previous tutorial](../using_actions), we will use {{< api-link module="kconfigwidgets" link="KStandardAction" >}}. We add the actions in the same way as for the quit action and, for each one, we connect it to the appropriate slot that we declared in the header file.
The first thing we are going to do is provide the outward interface for the user so they can tell the application to load and save. Like with the quit action in [previous tutorial](../using_actions), we will use [KStandardAction](docs:kconfigwidgets;KStandardAction). We add the actions in the same way as for the quit action and, for each one, we connect it to the appropriate slot that we declared in the header file.
### Creating a new document
......@@ -148,13 +148,13 @@ const QUrl fileNameFromDialog = QFileDialog::getOpenFileUrl(this, i18n("Open Fil
Here we use the [QUrl](https://doc.qt.io/qt-5/qurl.html) class to handle files from remote locations.
Then we use the KIO library to retrieve our file. This allows us to open the file normally even if it's stored in a remote location like an FTP site. We make the following call to the {{< api-link module="kio" link="KIO::storedGet" >}} function with an argument for the file you wish to open or download:
Then we use the KIO library to retrieve our file. This allows us to open the file normally even if it's stored in a remote location like an FTP site. We make the following call to the [KIO::storedGet](docs:kio;KIO::storedGet) function with an argument for the file you wish to open or download:
```c++
const KIO::Job *job = KIO::storedGet(fileNameFromDialog);
```
The function returns a handle to a {{< api-link module="kio" link="KIO::Job" >}}, which we first connect to our `downloadFinished()` slot before "running" the job.
The function returns a handle to a [KIO::Job](docs:kio;KIO::Job), which we first connect to our `downloadFinished()` slot before "running" the job.
```c++
connect(job, &KJob::result, this, &KJob::downloadFinished);
......@@ -170,7 +170,7 @@ fileName.clear();
Otherwise, we continue with opening the file.
The data that `storedGet()` successfully downloaded, in this case the contents of our text file, is stored in the data member of a {{< api-link module="kio" link="KIO::StoredTransferJob" >}} class. But in order to display the contents of the file at text, we must use a [QTextStream](https://doc.qt.io/qt-5/qtextstream.html). We create one by passing the the data of the `StoredTransferJob` to its constructor and then call its `readAll()` function to get the text from the file. This is then passed to the `setPlainText()` function of our text area.
The data that `storedGet()` successfully downloaded, in this case the contents of our text file, is stored in the data member of a [KIO::StoredTransferJob](docs:kio;KIO::StoredTransferJob) class. But in order to display the contents of the file at text, we must use a [QTextStream](https://doc.qt.io/qt-5/qtextstream.html). We create one by passing the the data of the `StoredTransferJob` to its constructor and then call its `readAll()` function to get the text from the file. This is then passed to the `setPlainText()` function of our text area.
{{< alert title="Note" color="info" >}}
......@@ -183,7 +183,7 @@ Again, for simplicity's sake, this tutorial only saves text files to local disk.
{{< readfile file="/content/docs/getting-started/saving_and_loading/CMakeLists.txt" highlight="cmake" >}}
Since we are now using the KIO library, we must tell CMake to link against it. We do this by passing `KIO` to the `find_package()` function and `KF5::KIOCore` to `target_link_libraries()` function.
Since we are now using the KIO library, we must tell CMake to link against it. We do this by passing `KIO` to the `find_package()` function and `KF5::KIOCore` to `target_link_libraries()` function.
With this file, the tutorial can be built and run in the same way as the [previous tutorial](../using_actions).
......
......@@ -36,7 +36,7 @@ Only a function void `setupActions()` has been added which will do all the work
## Explanation
This builds upon the {{< api-link module="kxmlgui" link="KXmlGuiWindow" >}} code from [the main window](main_window). Most of the changes are to mainwindow.cpp, an important structural change being that the constructor for MainWindow now calls `setupActions()` instead of `setupGUI()`. `setupActions()` is where the new QAction code goes before finally calling `setupGUI()` itself.
This builds upon the [KXmlGuiWindow](docs:kxmlgui;KXmlGuiWindow) code from [the main window](main_window). Most of the changes are to mainwindow.cpp, an important structural change being that the constructor for MainWindow now calls `setupActions()` instead of `setupGUI()`. `setupActions()` is where the new QAction code goes before finally calling `setupGUI()` itself.
### Creating the QAction object
......@@ -94,7 +94,7 @@ Here, the `clearAction` QAction is added to the collection and given a name of `
### Connecting the action
Now that the action is fully set up, it needs to be connected to something useful. In this case (because we want to clear the text area), we connect our action to the clear() action belonging to a KTextEdit (which, unsurprisingly, clears the KTextEdit)
Now that the action is fully set up, it needs to be connected to something useful. In this case (because we want to clear the text area), we connect our action to the clear() action belonging to a KTextEdit (which, unsurprisingly, clears the KTextEdit)
```c++
......@@ -122,11 +122,11 @@ At the moment, the new "Clear" action has been created but it hasn't been associ
### Defining your own help menu
The Help menu has been standardized to ease the lives of both developers and users, which is why all KDE software Help menus look the same. If you want to create your own help menu, search for the explanation around `showAboutApplication()` in from the {{< api-link module="kxmlgui" link="KHelpMenu" >}} class in XMLGUI.
The Help menu has been standardized to ease the lives of both developers and users, which is why all KDE software Help menus look the same. If you want to create your own help menu, search for the explanation around `showAboutApplication()` in from the [KHelpMenu](docs:kxmlgui;KHelpMenu) class in XMLGUI.
### XMLGUI
The `setupGUI()` function in {{< api-link module="kxmlgui" link="KXmlGuiWindow" >}} depends on the XMLGUI system to construct the GUI, which XMLGUI does by parsing an XML file description of the interface.
The `setupGUI()` function in [KXmlGuiWindow](docs:kxmlgui;KXmlGuiWindow) depends on the XMLGUI system to construct the GUI, which XMLGUI does by parsing an XML file description of the interface.
The rule for naming this XML file is `appnameui.rc`, where appname is the name you set in :kcorewidgetsapi:`KAboutData` (in this case, tutorial3). So in our example, the file is called `texteditorui.rc`, and is located in the build directory. Where the file will ultimately be placed is handled by CMake.
......
......@@ -7,7 +7,7 @@ weight: 2
When you create your own KDE application you will probably want to have icons in it respecting your users icon theme.
This is possible with the help of [QIcon::fromTheme](https://doc.qt.io/qt-5/qicon.html#fromTheme) for QtWidgets application or [Kirigami](https://api.kde.org/frameworks/kirigami/html/classIcon.html) for QtQuick application. Both function take as argument, the name of the icon in the icon theme.
This is possible with the help of [QIcon::fromTheme](https://doc.qt.io/qt-5/qicon.html#fromTheme) for QtWidgets application or [Kirigami's Icon](docs:kirigami2;Icon) for QtQuick application. Both function take as argument, the name of the icon in the icon theme.
Plasma and all the other major Linux deskops follow the [freedesktop icon specification](http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html) and [naming specification](http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html). A fallback mechanism is also present so that if the `document-open-recent` icon is not present, the `document-open` icon will be displayed instead and if the `document-open` icon is also not present the `document` icon will be displayed.
......
......@@ -33,7 +33,7 @@ Plasma is very modular. Plasma is shipped with preinstalled modules in your root
* System/Default `/usr/share/plasma/wallpapers/`
* User Installed `~/.local/share/plasma/wallpapers/`
* **Application Style** (aka Window Decoration) is the window titlebar.
* Window Decorations are C++ plugins implementing the [KDecoration2 API](https://api.kde.org/kdecoration/html/index.html). You will be unable to easily fork the default Breeze decoration as it's C++, however there is a preinstalled Aurorae plugin that can be themed with SVGs.
* Window Decorations are C++ plugins implementing the [KDecoration2 API](docs:kdecoration2). You will be unable to easily fork the default Breeze decoration as it's C++, however there is a preinstalled Aurorae plugin that can be themed with SVGs.
* System/Default `/usr/share/aurorae/themes/` (empty usually)
* User Installed `~/.local/share/aurorae/themes/` ([KDE Store Category](https://store.kde.org/browse/cat/114/order/latest/))
* Tutorial: [techbase.kde.org/User:Mgraesslin/Aurorae](https://techbase.kde.org/User:Mgraesslin/Aurorae)
......
......@@ -28,7 +28,7 @@ Every widget by default has a configure action when you right click the widget c
`main.xml` is where you define the properties that will be serialized into `~/.config/plasma-org.kde.plasma.desktop-appletsrc`. All properties will be accesible with `plasmoid.configuration.variableName` reguardless of was group it's in.
[KConfig](https://api.kde.org/frameworks/kconfig/html/annotated.html) has a variety of data types:
[KConfig](docs:kconfig;annotated.html) has a variety of data types:
* `Int` for an Integer number
* `Double` for a double precision floating point number (Real)
......
......@@ -159,7 +159,7 @@ The `new Date()` should be familiar if you come from a javascript background. We
To use the "time" data engine, we use [`PlasmaCore.DataSource`](https://github.com/KDE/plasma-framework/blob/master/src/declarativeimports/core/datasource.h) to connect to it. The "time" needs us to connect to our "Local" timezone. Once connected, it gives us a DateTime object we can access using `dataSource.data.Local.DateTime`. This property will update every 60000 milliseconds, or every 1 minute.
We also tell the data engine to align these updates to the next minute. If we want to modify this to update every second, we'd change the interval to `interval: 1000` (1 second), then remove the `intervalAlignment` assignment since there isn't an "AlignToSecond", just a [`PlasmaCore.Types.NoAlignment`](https://api.kde.org/frameworks/plasma-framework/html/classPlasma_1_1Types.html#ab7f729a56f6c44a067c79ca5354b8d64).
We also tell the data engine to align these updates to the next minute. If we want to modify this to update every second, we'd change the interval to `interval: 1000` (1 second), then remove the `intervalAlignment` assignment since there isn't an "AlignToSecond", just a [PlasmaCore.Types.NoAlignment](docs:plasma;Plasma::Types::IntervalAlignment).
A clock can then use Qt's `Qt.formatTime(currentDateTime)` to display the time in a human readable format. You can read more about that function on the Qt documentation for [`Qt.formatDateTime(...)`](http://doc.qt.io/qt-5/qml-qtqml-qt.html#formatDateTime-method).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment