Thanks a zillion. For the record:
qtexttospeech.h already has on line 118 Q_DECLARE_METATYPE(QTextToSpeech::State)
Hence, what's missing is the qRegisterMetaType part. Which I am adding in main.cpp before the QTextToSpeech module is loaded.
qRegisterMetaType<QTextToSpeech::State>("State");
QTextToSpeech* speech = new QTextToSpeech;
Then, in main.qml, I am catching the state changed signals and the state like this:
Connections {
target: speech
onStateChanged: {
console.log("speech.state "+ speech.state);
if (speech.state == 1){
console.log("--- we are speaking! ---");
} else if (speech.state == 0){
console.log("--- speaking stopped! ---");
}
}
}