forked from qt-creator/qt-creator
Lua: Correctly load QIcon from file path for ToggleAspect
Change-Id: Ie2fd51b9783930105d1d43591b30a19427058fb8 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
#include "../luaengine.h"
|
#include "../luaengine.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
#include <utils/aspects.h>
|
#include <utils/aspects.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
@@ -479,11 +480,11 @@ void setupSettingsModule()
|
|||||||
options,
|
options,
|
||||||
[](ToggleAspect *aspect, const std::string &key, const sol::object &value) {
|
[](ToggleAspect *aspect, const std::string &key, const sol::object &value) {
|
||||||
if (key == "offIcon")
|
if (key == "offIcon")
|
||||||
aspect->setOffIcon(QIcon(value.as<QString>()));
|
aspect->setOffIcon(toIcon(value.as<IconFilePathOrString>())->icon());
|
||||||
else if (key == "offTooltip")
|
else if (key == "offTooltip")
|
||||||
aspect->setOffTooltip(value.as<QString>());
|
aspect->setOffTooltip(value.as<QString>());
|
||||||
else if (key == "onIcon")
|
else if (key == "onIcon")
|
||||||
aspect->setOnIcon(QIcon(value.as<QString>()));
|
aspect->setOnIcon(toIcon(value.as<IconFilePathOrString>())->icon());
|
||||||
else if (key == "onTooltip")
|
else if (key == "onTooltip")
|
||||||
aspect->setOnTooltip(value.as<QString>());
|
aspect->setOnTooltip(value.as<QString>());
|
||||||
else if (key == "onText")
|
else if (key == "onText")
|
||||||
|
Reference in New Issue
Block a user