How to connect a signal to another in QML
Solved
QML and Qt Quick
-
As I know, I can connect a signal to another signal with "connect() method" in cpp.
so, I thought It would also possible in QML, I have no ideal about the way though.
function connectActionTo(item) { if (item === undefined || item.senderType === undefined) { return; } if (item.pressed !== undefined) { // some code about connection for two object's signals } if (item.clicked !== undefined) { // (tried 1), but no effect. I am expecting something similar under line. item.clicked = function(item){action.clicked(item.type);} } }
Any Your Comments Would Be Welcome. Thank You :)
-
@hslee_6560 said in How to connect a signal to another in QML:
so, I thought It would also possible in QML
You're right! https://doc.qt.io/qt-5/qtqml-syntax-signals.html