diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-08-18 15:44:52 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2022-08-24 12:58:38 +0200 |
commit | ebfaceedf7413ce70e6ae411c821e6c3e68aa37f (patch) | |
tree | 823dfbe6faa238345f18f1af2ab92e4d620dcd84 /examples/texttospeech | |
parent | 5c37a8c9ffea848f4115e3b89f50bddc4ea4a6de (diff) |
Examples: Add some missing slot decorators
As unearthed by the warnings added by the logging category.
As a drive-by, fix some imports.
Pick-to: 6.3 6.2
Task-number: PYSIDE-2033
Change-Id: I3812c705b60eb7be744c3532fcfb0e4024763885
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'examples/texttospeech')
-rw-r--r-- | examples/texttospeech/hello_speak/hello_speak.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/texttospeech/hello_speak/hello_speak.py b/examples/texttospeech/hello_speak/hello_speak.py index f511ac6f1..d7612f362 100644 --- a/examples/texttospeech/hello_speak/hello_speak.py +++ b/examples/texttospeech/hello_speak/hello_speak.py @@ -4,7 +4,7 @@ """PySide6 QTextToSpeech example""" import sys -from PySide6.QtCore import Qt +from PySide6.QtCore import Qt, Slot from PySide6.QtWidgets import (QApplication, QComboBox, QFormLayout, QHBoxLayout, QLineEdit, QMainWindow, QPushButton, QSlider, QWidget) @@ -53,12 +53,14 @@ class MainWindow(QMainWindow): self.setWindowTitle('QTextToSpeech Example (no engines available)') self.sayButton.setEnabled(False) + @Slot() def say(self): self.sayButton.setEnabled(False) self.engine.setVoice(self.voices[self.voiceCombo.currentIndex()]) self.engine.setVolume(float(self.volumeSlider.value()) / 100) self.engine.say(self.text.text()) + @Slot("QTextToSpeech::State") def stateChanged(self, state): if (state == QTextToSpeech.State.Ready): self.sayButton.setEnabled(True) |