Fix QML warnings due to depricated on<signal> calls in Connections

As of 5.12, the signals used in connections should not be declared as on<signal>, but as
function on<signal>(arguments).
This commit is contained in:
Kostas Karmas 2021-03-30 08:46:14 +02:00
parent a277adae64
commit 7827b36ab7
46 changed files with 113 additions and 122 deletions

View file

@ -78,6 +78,14 @@ Item
property int shadowOffset: 2
onEnabledChanged:
{
if (!base.enabled && expanded)
{
toggleContent()
}
}
function toggleContent()
{
if (content.visible)
@ -98,19 +106,6 @@ Item
value: base.enabled ? headerBackgroundColor : UM.Theme.getColor("disabled")
}
// The panel needs to close when it becomes disabled
Connections
{
target: base
onEnabledChanged:
{
if (!base.enabled && expanded)
{
toggleContent()
}
}
}
implicitHeight: 100 * screenScaleFactor
implicitWidth: 400 * screenScaleFactor
@ -247,7 +242,7 @@ Item
{
// Since it could be that the content is dynamically populated, we should also take these changes into account.
target: content.contentItem
onWidthChanged: content.width = content.contentItem.width + 2 * content.padding
onHeightChanged: content.height = content.contentItem.height + 2 * content.padding
function onWidthChanged() { content.width = content.contentItem.width + 2 * content.padding }
function onHeightChanged() { content.height = content.contentItem.height + 2 * content.padding }
}
}