Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
6.5.1
-
None
Description
Attached a small example which exposes a C++ API to QML. The C++ API provides two signals:
void somethingHappened(const QString& string); void somethingHappened(int number);
The QString version is emitted after one second.
On QML the signal is handled like this:
SimpleAPI {
onSomethingHappened: (argument) => {
console.log("QML", argument)
}
}
The signal handler is never called. Changing the C++ code to emit both signals will call the QML handler. But only for the int version.
Atleast in https://doc.qt.io/qt-6/qtqml-syntax-signals.html i couldn't find any other way to create the handler which works in both cases. (Or create another handler for the other signal).