Make sure QTextToSpeech is deleted at the right time
This commit is contained in:
parent
ad4eb3d502
commit
e8d83d205b
|
@ -1,11 +1,12 @@
|
||||||
#include "speech.h"
|
#include "speech.h"
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
#include <QtTextToSpeech/QTextToSpeech>
|
#include <QtTextToSpeech/QTextToSpeech>
|
||||||
|
|
||||||
#include <snore.h>
|
#include <snore.h>
|
||||||
Speech::Speech()
|
Speech::Speech()
|
||||||
: Snore::SnoreSecondaryBackend()
|
: Snore::SnoreSecondaryBackend()
|
||||||
, m_speech(new QTextToSpeech(this))
|
, m_speech(new QTextToSpeech(qApp))
|
||||||
{
|
{
|
||||||
connect(m_speech, &QTextToSpeech::stateChanged, this, [this](QTextToSpeech::State state) {
|
connect(m_speech, &QTextToSpeech::stateChanged, this, [this](QTextToSpeech::State state) {
|
||||||
qCDebug(SNORE) << state;
|
qCDebug(SNORE) << state;
|
||||||
|
|
Loading…
Reference in New Issue