qml: do not use property to represent signals

This commit is contained in:
Fatih Uzunoglu 2023-12-04 20:53:36 +02:00 committed by Jean-Baptiste Kempf
parent a5c39d7647
commit b84994a733
3 changed files with 24 additions and 10 deletions

View File

@ -158,8 +158,10 @@ FocusScope {
availableWidth: rowLayout.width
availableHeight: rowLayout.height
requestLockUnlockAutoHide: controlLayout.requestLockUnlockAutoHide
menuOpened: controlLayout.menuOpened
Component.onCompleted: {
requestLockUnlockAutoHide.connect(controlLayout.requestLockUnlockAutoHide)
menuOpened.connect(controlLayout.menuOpened)
}
}
Item {

View File

@ -30,8 +30,8 @@ Repeater {
property real availableWidth: Number.MAX_VALUE
property real availableHeight: Number.MAX_VALUE
property var menuOpened
property var requestLockUnlockAutoHide
signal requestLockUnlockAutoHide(bool lock)
signal menuOpened(var menu)
// NOTE: We apply the 'navigation chain' after adding the item.
onItemAdded: item.applyNavigation()

View File

@ -110,6 +110,11 @@ FocusScope {
availableWidth: loaderLeftRight.width
availableHeight: loaderLeftRight.height
Component.onCompleted: {
requestLockUnlockAutoHide.connect(playerControlLayout.requestLockUnlockAutoHide)
menuOpened.connect(playerControlLayout.menuOpened)
}
}
Item {
@ -151,6 +156,11 @@ FocusScope {
availableWidth: loaderLeftRight.width
availableHeight: loaderLeftRight.height
Component.onCompleted: {
requestLockUnlockAutoHide.connect(playerControlLayout.requestLockUnlockAutoHide)
menuOpened.connect(playerControlLayout.menuOpened)
}
}
}
}
@ -191,9 +201,10 @@ FocusScope {
Navigation.parentItem: playerControlLayout
Navigation.rightItem: loaderCenter.item
onRequestLockUnlockAutoHide: playerControlLayout.requestLockUnlockAutoHide(lock)
onMenuOpened: playerControlLayout.menuOpened(menu)
Component.onCompleted: {
requestLockUnlockAutoHide.connect(playerControlLayout.requestLockUnlockAutoHide)
menuOpened.connect(playerControlLayout.menuOpened)
}
}
}
@ -248,9 +259,10 @@ FocusScope {
Navigation.leftItem: loaderLeft.item
Navigation.rightItem: loaderRight.item
onRequestLockUnlockAutoHide: playerControlLayout.requestLockUnlockAutoHide(lock)
onMenuOpened: playerControlLayout.menuOpened(menu)
Component.onCompleted: {
requestLockUnlockAutoHide.connect(playerControlLayout.requestLockUnlockAutoHide)
menuOpened.connect(playerControlLayout.menuOpened)
}
}
}