ConfigurationView

Search for usage in LXR

ConfigurationView Class Reference

Properties

list< ConfigurationModulemodules
 
string title
 
KirigamiApplicationWindow window
 

Public Member Functions

void open (defaultModule='')
 

Detailed Description

This is an abstract view to display the configuration of an application.

The various configuration modules can be defined by providing ConfigurationModule to the modules property.

On desktop, this will display the modules in a list view and displaying the actual page next to it. On mobile, only the list of modules will be initially displayed.

import QtQuick.Controls as Controls
import org.kde.kirigamiaddons.settings as KirigamiSettings
Controls.Button {
id: button
KirigamiSettings.ConfigurationView {
id: configuration
window: button.Controls.ApplicationWindow.window as Kirigami.ApplicationWindow
modules: [
KirigamiSettings.ConfigurationModule {
moduleId: "appearance"
text: i18nc("@action:button", "Appearance")
icon.name: "preferences-desktop-theme-global"
page: () => Qt.createComponent("org.kde.tokodon", "AppearancePage")
},
...
KirigamiSettings.ConfigurationModule {
moduleId: "about"
text: i18nc("@action:button", "About Tokodon")
icon.name: "help-about"
page: () => Qt.createComponent("org.kde.kirigamiaddons.formcard", "AboutPage")
category: i18nc("@title:group", "About")
},
KirigamiSettings.ConfigurationModule {
moduleId: "aboutkde"
text: i18nc("@action:button", "About KDE")
icon.name: "kde"
page: () => Qt.createComponent("org.kde.kirigamiaddons.formcard", "AboutKDE")
category: i18nc("@title:group", "About")
}
]
}
icon.name: 'settings-configure-symbolic'
text: i18nc("@action:button", "Settings")
onClicked: configuration.open()
}
An AboutPage that displays the about data using Form components.
Definition AboutPage.qml:24
This object holds the information of configuration module.
void open(defaultModule='')
Open the configuration window.
string title
This property holds the title of the config view.
QString i18nc(const char *context, const char *text, const TYPE &arg...)

This will result in the following dialog on desktop.

On the following page on mobile.

Since
KirigamiAddons 1.3.0

Definition at line 71 of file ConfigurationView.qml.

Property Documentation

◆ modules

list<ConfigurationModule> ConfigurationView::modules
read

This property holds the list of pages for the settings.

Definition at line 82 of file ConfigurationView.qml.

◆ title

string ConfigurationView::title
read

This property holds the title of the config view.

By default this is "Settings"

Definition at line 78 of file ConfigurationView.qml.

◆ window

KirigamiApplicationWindow ConfigurationView::window
read

This property holds the parent window.

This needs to be set before calling open.

Definition at line 88 of file ConfigurationView.qml.

Member Function Documentation

◆ open()

void ConfigurationView::open ( defaultModule = '')

Open the configuration window.

@params defaultModule The moduleId of the default configuration that should be preselected when opening the configuration view. By default is not specified, this will choose the first module.


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:49:32 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.