summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-01-22 14:23:58 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-01-23 11:20:46 +0100
commitc7f5f16785cec5fddffc65aa5a864c1b4660bb77 (patch)
treed6c9949e016ed76e085a09516bc9325195477198 /examples
parent423eb551328863d1d9ac709ce42bd350f7091226 (diff)
Rename QSpeech to QTextToSpeech
Change-Id: Iab0b7b3b4409c785c57ca015c4f3f4a0d7a49dc5 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/widgets/hello_speak/hello_speak.pro2
-rw-r--r--examples/widgets/hello_speak/mainwindow.cpp26
-rw-r--r--examples/widgets/hello_speak/mainwindow.h6
3 files changed, 17 insertions, 17 deletions
diff --git a/examples/widgets/hello_speak/hello_speak.pro b/examples/widgets/hello_speak/hello_speak.pro
index a07a7e9..40df883 100644
--- a/examples/widgets/hello_speak/hello_speak.pro
+++ b/examples/widgets/hello_speak/hello_speak.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
-QT += widgets speech
+QT += widgets texttospeech
SOURCES = main.cpp \
mainwindow.cpp
diff --git a/examples/widgets/hello_speak/mainwindow.cpp b/examples/widgets/hello_speak/mainwindow.cpp
index 47fcfd4..460aa07 100644
--- a/examples/widgets/hello_speak/mainwindow.cpp
+++ b/examples/widgets/hello_speak/mainwindow.cpp
@@ -47,20 +47,20 @@ MainWindow::MainWindow(QWidget *parent)
ui.setupUi(this);
connect(ui.speakButton, &QPushButton::clicked, this, &MainWindow::speak);
- connect(ui.stopButton, &QPushButton::clicked, &m_speech, &QSpeech::stop);
- connect(ui.pauseButton, &QPushButton::clicked, &m_speech, &QSpeech::pause);
- connect(ui.resumeButton, &QPushButton::clicked, &m_speech, &QSpeech::resume);
+ connect(ui.stopButton, &QPushButton::clicked, &m_speech, &QTextToSpeech::stop);
+ connect(ui.pauseButton, &QPushButton::clicked, &m_speech, &QTextToSpeech::pause);
+ connect(ui.resumeButton, &QPushButton::clicked, &m_speech, &QTextToSpeech::resume);
connect(ui.pitch, SIGNAL(valueChanged(double)), &m_speech, SLOT(setPitch(double)));
connect(ui.rate, SIGNAL(valueChanged(double)), &m_speech, SLOT(setRate(double)));
connect(ui.volume, SIGNAL(valueChanged(double)), &m_speech, SLOT(setVolume(double)));
- connect(&m_speech, &QSpeech::stateChanged, this, &MainWindow::stateChanged);
+ connect(&m_speech, &QTextToSpeech::stateChanged, this, &MainWindow::stateChanged);
connect(ui.language, SIGNAL(currentIndexChanged(int)), this, SLOT(languageSelected(int)));
// connect(ui.voiceType, SIGNAL(currentIndexChanged(QString)), &m_speech, SLOT(setVoiceType(QString)));
// QStringList voices;
-// foreach (const QSpeechVoice &voice, m_speech.availableVoices()) {
+// foreach (const QTextToSpeechVoice &voice, m_speech.availableVoices()) {
// voices.append(voice.locale().name() + " (" + voice.name() + ")");
// }
@@ -81,24 +81,24 @@ void MainWindow::stop()
m_speech.stop();
}
-void MainWindow::stateChanged(QSpeech::State state)
+void MainWindow::stateChanged(QTextToSpeech::State state)
{
- if (state == QSpeech::Speaking) {
+ if (state == QTextToSpeech::Speaking) {
ui.statusbar->showMessage("Speech started...");
- } else if (state == QSpeech::Ready)
+ } else if (state == QTextToSpeech::Ready)
ui.statusbar->showMessage("Speech stopped...", 2000);
- else if (state == QSpeech::Paused)
+ else if (state == QTextToSpeech::Paused)
ui.statusbar->showMessage("Speech paused...");
else
ui.statusbar->showMessage("Speech error!");
- ui.pauseButton->setEnabled(state == QSpeech::Speaking);
- ui.resumeButton->setEnabled(state == QSpeech::Paused);
- ui.stopButton->setEnabled(state == QSpeech::Speaking || QSpeech::Paused);
+ ui.pauseButton->setEnabled(state == QTextToSpeech::Speaking);
+ ui.resumeButton->setEnabled(state == QTextToSpeech::Paused);
+ ui.stopButton->setEnabled(state == QTextToSpeech::Speaking || QTextToSpeech::Paused);
}
void MainWindow::languageSelected(int language)
{
-// QSpeechVoice voice = m_speech.availableVoices()[language];
+// QTextToSpeechVoice voice = m_speech.availableVoices()[language];
// m_speech.setVoice(voice);
}
diff --git a/examples/widgets/hello_speak/mainwindow.h b/examples/widgets/hello_speak/mainwindow.h
index 6c35248..bbfb920 100644
--- a/examples/widgets/hello_speak/mainwindow.h
+++ b/examples/widgets/hello_speak/mainwindow.h
@@ -46,7 +46,7 @@
#include "ui_mainwindow.h"
-#include <QSpeech>
+#include <QTextToSpeech>
class MainWindow : public QMainWindow
{
@@ -58,12 +58,12 @@ public slots:
void speak();
void stop();
- void stateChanged(QSpeech::State state);
+ void stateChanged(QTextToSpeech::State state);
void languageSelected(int language);
private:
Ui::MainWindow ui;
- QSpeech m_speech;
+ QTextToSpeech m_speech;
};
#endif