-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix saving stringlist in Settings via script
We can't use a QVariant, as it does not support list. We have to take a QJSValue, and transform it in a QVariant ?!
- Loading branch information
Showing
8 changed files
with
79 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,4 +45,5 @@ Script { | |
verify(Settings.hasValue("/numbers")); | ||
compare(Settings.value("/numbers"), undefined); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
This file is part of Knut. | ||
SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]> | ||
SPDX-License-Identifier: GPL-3.0-only | ||
Contact KDAB at <[email protected]> for commercial licensing options. | ||
*/ | ||
|
||
import QtQuick | ||
import Knut | ||
|
||
Script { | ||
// We want to test the writing of settings without any project, that's why it's in a different QML file | ||
function test_setSettings() { | ||
verify(Settings.setValue("/int_val", 10)) | ||
compare(Settings.value("/int_val"), 10) | ||
|
||
verify(Settings.setValue("double_val", 3.5)) | ||
compare(Settings.value("double_val"), 3.5) | ||
|
||
verify(Settings.setValue("boolean/val", true)) | ||
compare(Settings.value("boolean/val"), true) | ||
|
||
verify(Settings.setValue("/stringlistval", ["a", "b", "c"])) | ||
compare(Settings.value("/stringlistval"), ["a", "b", "c"]) | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters