KConfig
Persistent platform-independent application settings.
KConfig provides an advanced configuration system. It is made of two parts: KConfigCore and KConfigGui.
KConfigCore provides access to the configuration files themselves. It features:
- Code generation: describe your configuration in an XML file, and use kconfig_compiler to generate classes that read and write configuration entries.
- Cascading configuration files (global settings overridden by local settings).
- Optional shell expansion support.
- The ability to lock down configuration options.
KConfigGui provides a way to hook widgets to the configuration so that they are automatically initialized from the configuration and automatically propagate their changes to their respective configuration files.
Using the Module
Using a Qt module's C++ API requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including CMake and qmake.
Building with CMake
Use the find_package() command to locate the needed module component in the Qt6 package:
find_package(Qt6 REQUIRED COMPONENTS KF6)
target_link_libraries(mytarget PRIVATE Qt6::KF6)
For more details, see the Build with CMake overview.