Qt 6 是努力使框架更高效,且更易于使用的结果。
为兼容每个发行的所有公共 API,我们试着维护二进制和源代码。但是,为使 Qt 成为更优框架,一些改变是不可避免的。
In this topic we summarize those changes in Qt TextToSpeech , and provide guidance to handle them.
All engines that were available in Qt 5 are also available in Qt 6.4. For a complete list of available engines in Qt 6.4, see Qt TextToSpeech Engines .
Engines can now receive additional configuration parameters. When constructing a QTextToSpeech instance, pass a QVariantMap with engine-specific key/value pairs.
The Qt TextToSpeech module has undergone some basic consolidation and cleanup. There should be minimal porting effort to be able to switch to Qt 6.
The
QTextToSpeech::State
enum value
BackendError
has been renamed to
Error
. Detailed error information is available via
QTextToSpeech::errorReason
() 和
QTextToSpeech::errorString
().
新的 engine property allows changing of the engine on an initialized QTextToSpeech 对象。
The pause and QTextToSpeech::stop slots take a QTextToSpeech::BoundaryHint enum value. This will break the compilation for signal/slot connections that use PMF syntax if the signal has parameters that were previously ignored:
connect(stopButton, &QPushButton, tts, &QTextToSpeech::stop);
Either connect to a signal without parameters, or use a lambda and call the respective slot method explicitly:
connect(stopButton, &QPushButton, tts, [tts]{ tts->stop(); });
Existing code using the QVoice class continues to work as before. QVoice objects can now be serialized via QDataStream .
These classes have been removed from the public API. They still exist and are used by the available engine implementations, but they are not part of the documented and supported API, and are likely to change in future releases.