Fix most qml warnings in StateKeys

This commit is contained in:
Tobias Fella
2025-09-15 13:25:41 +02:00
parent adb9e59503
commit 8dc7d1d39d
2 changed files with 8 additions and 4 deletions

View File

@@ -17,6 +17,8 @@ ecm_add_qml_module(Devtools GENERATE_PLUGIN_SOURCE
models/statefiltermodel.cpp
models/statekeysmodel.cpp
models/statemodel.cpp
DEPENDENCIES
QtCore
)
target_include_directories(Devtools PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/models)

View File

@@ -1,8 +1,9 @@
// SPDX-FileCopyrightText: 2024 Tobias Fella <tobias.fella@kde.org>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import QtQuick.Window
import org.kde.kirigami as Kirigami
@@ -30,14 +31,15 @@ FormCard.FormCardPage {
}
delegate: FormCard.FormButtonDelegate {
text: model.stateKey
onClicked: openEventSource(model.stateKey)
required property string stateKey
text: stateKey
onClicked: root.openEventSource(stateKey)
}
}
}
function openEventSource(stateKey: string): void {
root.Window.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'MessageSourceSheet'), {
(Kirigami.PageStack.pageStack as Kirigami.PageRow).pushDialogLayer(Qt.createComponent('org.kde.neochat', 'MessageSourceSheet'), {
model: stateKeysModel,
allowEdit: true,
room: root.room,