Plasma Settings is an app, much like Plasma Desktop’s System Settings that
shows and loads configuration modules. These configuration modules are
plugins providing a QML package and an optional C++-plugin which exports
custom-written configuration objects as QObject to the declarative
environment.

You can query available modules using the –list argument to
plasma-settings:

The Plasma Settings app consists of a number of parts, a Kirigami app that provides the chrome for plasma-settings, a
set of Declarative components which encapsulate loading settings modules
and a set of settings modules, which provide the UI and backend code for
a specific settings domain (i.e. Time and Date, Theme settings, etc.).

Make sure the names of the .desktop files in CMakeLists.txt are correct,
since incorrect names lead to problems finding and loading your package,
or even to conflicts between different modules. In case of doubt check
active-settings –list for already installed modules.

Now that we have created the library, let’s have a closer look at the QML kpackage.
Every package needs to contain a metadata.desktop file, which holds the plugin information,
which script to load from the plugin initially, and a bunch of metadata, just like
normal Plasma Packages. A simple metadata.desktop file will look like
this:

The interesting bits, specific to active-settings are the plugin name,
the package name and the mainscript. The plugin name is used to find the
package.
Web.qml points to a normal Item in a file, normal rules apply
here.

It’s recommended to use ScrollViewKCM or SimpleKCM as the root item of your QML file,
so your kcm visually fits into the settings app.

The ConfigModule class that your library inherits from
provides a multilevel page api that you can use to push and pop pages into and from the settings app.