Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
Description
I propose revisiting https://bugreports.qt.io/browse/QTBUG-9291
- It's received more interest over the years
- Since then, `ui.qml` has been introduced. In a ui.qml file, you even do simple forwarding like button.onClicked: root.clicked()–this triggers a warning and I believe it stops QDS. You must add a whole connections block to forward your signal.
Example situation: forward a signal in a .ui.qml file
Current (4 lines of code, 6 physical lines of code, 1 new block):
MyComplexComponent { signal leftButtonClicked(QtObject mouseEvent) ......... MyDeeplyNestedButton { id: leftButton } Connections { target: leftButton function onClicked (mouseEvent) { leftButtonClicked(mouseEvent); } } }
Desired (1 line of code, no new blocks):
MyComplexComponent { signal alias leftButtonClicked: leftButton.clicked ......... MyDeeplyNestedButton { id: leftButton } }
And of course this shortcut is useful in standard qml, not just ui.qml!
Attachments
Issue Links
- duplicates
-
QTBUG-9291 Allow signals forwarding in QML
-
- Closed
-