summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Port from qAsConst() to std::as_const()Marc Mutz2022-11-141-1/+1
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace. This is a 6.4 re-run of the script we ran in dev, in order to avoid conflicts between the branches when cherry-picking. Change-Id: Id8fb16dfd76ed43da95193b7785856c2694479b6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Quick example: improve layout codeVolker Hilsheimer2022-09-121-5/+2
| | | | | | | | | | | | | | | Give the text area a minimum height, it is invisible otherwise. Remove unnecessary constraints on the root item. The layout is still not perfect, it seems to lack margin on the right when run on macOS, but those are probably bugs in Quick Layouts that need to be fixed there. Change-Id: Icd91ffb66cfec4e5a940d5a6767a8c24329c61ea Reviewed-by: Jeremy Whiting <jpwhiting@kde.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 9de53a16e1abe846c7a1a63618b9bf1d20d7618a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Qualify TextToSpeech linksKai Köhne2022-08-161-1/+1
| | | | | | | | | | | | | | Without further qualification, TextToSpeech does automatically link to the QML type. Make an explicit link to "Qt TextToSpeech" landing page where appropriate. Fixes: QTBUG-105477 Change-Id: Idcc1ea9a1bf3fd984754e38f1c07b3aa96e582c3 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit ea1a7b7f3bff42df0aaeab19cea633429da8bdbf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Use consistent names for .html filesKai Köhne2022-08-112-2/+2
| | | | | | | | | Always start with "qt" Change-Id: I24f617bf8b16758470382cd390021a163b48db48 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit a55442d820550e1af74c491ec3f3604361b332f4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix and edit the example documentationVolker Hilsheimer2022-07-135-14/+19
| | | | | | | | | | | | | | | | | | | If the exampledirs variable in qdocconf doesn't include the /speech subdirectory, but each example page does, then the link generated to code.qt.io is incorrect. Since the qdocconf is for the texttospeech module, all examples will live in the same tree anyway. Link to Qt Widgets and Qt Quick Controls from the respective examples, which requires that those modules are added as dependencies. Improve the phrasing of the text, and update and optimize the screenshots of the examples. Change-Id: I3de4e707c2aeed40735a714934adea59afdea1e8 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 86b86e5c48481f81fa43d3da49fd5177bc9925ef) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use SPDX license identifiersLucie Gérard2022-06-226-248/+12
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: I5a15004abaab3f2d002adf47ae053b95abb41cb8 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 22bb7ab69fd64afde34c0fb6ef9154225590801d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix syntax errorVolker Hilsheimer2022-05-231-1/+1
| | | | | | | Amends 9b60e7bd06c26507141a8e1de156638bc7dd9252. Change-Id: If0b530d2cab209e62ac8c83078f0b226a1a1cf3b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Prepare boundary hint in QTextToSpeechAxel Spoerl2022-05-211-2/+2
| | | | | | | | | | Add enum class BoundaryHint in QTextToSpeech. Add respective parameters in stop() and pause(). Update documentation, and implement support on macOS and iOS engines. Change-Id: I616a8763520e197c3bf16118c111c3e114079b38 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Documentation fixesVolker Hilsheimer2022-05-216-2/+46
| | | | | | | | | | | | | | | | | | The name of the module is QtTextToSpeech, not Qt Speech, rename things accordingly, esp the QML import URI, and adjust examples. Update the module's index page to use the global macro for generating the "Using the module" section, and add a changes file with some first bits about porting to Qt 6. Add an examples page and a documentation page for the Qt Quick example, which also needs a qmake project file to prevent a qdoc warning (even though there is no project that needs to be built). Change-Id: I29d9126f52dc0f3a0294a27a34af89daa249db5d Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
* Improve error handling in QTextToSpeechAxel Spoerl2022-05-201-1/+1
| | | | | | | | | | | | | | | | | | Add an enum class ErrorReason for error handling in QTextToSpeech. Rename BackendError to Error in enum QTextToSpeech::State, as the error might not be in the synthesizer, but the audio playback, or due to invalid input. Update all sources and tests referring to BackendError to use new name. Update documentation of enum QTextToSpeech::State, add documentation for new enum QTextToSpeech::ErrorReason. Add getters, setters, signals, and slots for error handling. Implement error handling for flite plugin, covering audio backend, initialization and synthesizing errors. For the other plugins, handle basic initialization errors. Change-Id: I233cf3876511176dd1a327546233d527596e1e7e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add a Qt Quick exampleVolker Hilsheimer2022-04-261-0/+221
| | | | | | | | Does what the widget example does, but suffers from some layout bugs in Qt Quick (Controls) that need to be addressed elsewhere. Change-Id: Ieabfef01667c2426bd2e590cad01a2815faaa3e6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Build documentationVolker Hilsheimer2022-04-072-2/+2
| | | | | | | | | | | | | | | Fix the CMakeLists file to point at the qdocconf file, and remove the qmake .pro file. The only module in the repository is the TextToSpeech module, so the documentation needs to live in the directory releative to that. This makes qdoc generate the documentation correctly, and without warnings. Change-Id: I4406ec5656641b46ec9d9bc154bc8dd10b271d3b Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Re-generate the CMake project filesFrederik Gladhorn2022-02-113-0/+54
| | | | | Change-Id: I85d3f7aeae6fe3971eec5b7d2da4e975c09b124c Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
* Use nullptr instead of 0 in examplePaul Wicking2020-08-151-1/+1
| | | | | | | | Fixes: QTBUG-86059 Pick-to: 5.15 Change-Id: Ifffad0a0767387c92325143a94700d8b5bff5600 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-262-2/+2
| | | | | | Task-number: QTBUG-84469 Change-Id: I1ceb2dffcc0437c2800869bdf7697c17e9f81266 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Update dependenciesFriedemann Kleint2020-04-161-5/+5
| | | | | | | in an attempt to fix WASM build errors. Change-Id: Ic4c99996d4115554b684508b8889dc1ea8400ff3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Only build example when we have widgetsFrederik Gladhorn2019-06-261-1/+1
| | | | | | Fixes: QTBUG-76691 Change-Id: Id26489f83ba4831e95c0e4b8fccfff8910ae82db Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* Eradicate Q_FOREACH loops and mark the module free of themMarc Mutz2019-06-191-4/+5
| | | | | | | | | | (and of Java-style iterators). Q_FOREACH is scheduled for deprecation, or at the very least banned from use in Qt code. Change-Id: Ic9cb269fb4dc27d00d80d0a956cef4a7e1136544 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Fix the build with -no-guiLiang Qi2019-03-081-1/+2
| | | | | Change-Id: Ice1d1f8bed5805584e3dee5f5839efe7ab8d52c2 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
* Doc: Add missing dots (qtspeech)Paul Wicking2018-06-191-1/+1
| | | | | | | Task-number: QTBUG-68933 Change-Id: I2ea514e4b3edf9f88bf5af6c5e6e5cc9fc87585d Reviewed-by: Jeremy Whiting <jpwhiting@kde.org> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* qtlite: Skip building examples when configured with no-feature-itemviewsRainer Keller2018-01-121-0/+1
| | | | | | Task-number: QTBUG-53141 Change-Id: Ia0ac2009e60e31f945c2af1716c4c4b13028c167 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Fix outdated FDL license headerv5.9.3Kai Koehne2017-10-174-14/+44
| | | | | | Change-Id: I25a965785799173daddbebe95c970e6db9e50de1 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* hello_speak example: Fix enum value used in boolean context5.8Marc Mutz2017-03-221-1/+1
| | | | | | | | | | | | | Forgot to compare to 'state'. Found by GCC 7: qt5/qtspeech/examples/speech/hello_speak/mainwindow.cpp:104:82: warning: enum constant in boolean context [-Wint-in-bool-context] ui.stopButton->setEnabled(state == QTextToSpeech::Speaking || QTextToSpeech::Paused); ^~~~~~ Change-Id: Ie1e62b32586b21739df50e77b15135be040a6e6c Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Fix compilationMaurice Kalinowski2016-06-151-0/+4
| | | | | | | | | | 5b5b7f97b833e9f91c41285718dc7b566cc37247 in qtbase requires any example to specify its install location. Hence add one for this example to make the module compile again. Change-Id: I7e91c3ca201b9d34f3c6c45b4949f4568b34127e Reviewed-by: Jeremy Whiting <jpwhiting@kde.org> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Align volume with qtmultimedia and others: 0.0 to 1.0Frederik Gladhorn2016-05-062-2/+8
| | | | | Change-Id: I0fe28819d6e7be48ddb587c21435f6be329f8ec5 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Revert "Add engine parameters in QTextToSpeech constructor"Frederik Gladhorn2016-04-131-1/+1
| | | | | | | | | | Having string based parameter passing is not Qt style, let's add getters and setters as needed. This reverts commit ca8768b90c07bff5804b1fbb704041a4472f65e9. Change-Id: Iff8edec13ac27371a116ed17f66cf90ab3a8f257 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Fix volume/rate slider setting in exampleFrederik Gladhorn2016-04-081-1/+1
| | | | | Change-Id: I7903c2039e2de0fadcdcbcb5aaa7a5a6321bf56a Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Improvements for the TTS example applicationTuomas Tuononen2016-04-051-1/+6
| | | | | | | | | | | - Remove double initialization of the default engine on startup - Preserve volume, pitch and speech rate when the engine changes - Enable QTextToSpeech log output Change-Id: I87e197315570c65e2dee9c66fde7eabd729f93f2 Reviewed-by: Jeremy Whiting <jpwhiting@kde.org> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Show language name and country in Language combo box for QLocale.Jeremy Whiting2016-04-051-1/+4
| | | | | | Change-Id: I16e1c6ffeea481dec314e8c8122abfd3ecd24822 Reviewed-by: Tuomas Tuononen <tuomas.tuononen@code-q.fi> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* QTextToSpeech: QObject *parent ctor args go lastMarc Mutz2016-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | This is one of the deepest and most long-standing Qt API design patterns: subclasses add ctor args _at the front_, not at the back. To compensate the slight SC breakage, add an overloaded ctor that only takes QObject *parent (also a Qt API pattern worth following), so the common case of new QTextToSpeech(this) continues to work. Change-Id: I7253abada1355e53e9817914abd80e8af17ce429 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Jeremy Whiting <jpwhiting@kde.org> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Add engine selection in the TTS example applicationTuomas Tuononen2015-10-163-48/+94
| | | | | | | | - Support for plug-in engines Change-Id: I9a4a1a1ceb45849b6a39dbf1473e6f9badf5d1a6 Reviewed-by: Jeremy Whiting <jpwhiting@kde.org> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Fix examples.pro after renameFrederik Gladhorn2015-08-311-1/+1
| | | | | | | Point to the right sub directory. Change-Id: I4ff4f9733cb9f67a2dad2d382f4273d44e49d846 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Doc: Added the necessary doc artifactsVenugopal Shivashankar2015-08-222-0/+40
| | | | | Change-Id: I4aa939df4f73cf095fbe73c6afe38bdd18a46c42 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Doc: Moved the examples to examples/speechVenugopal Shivashankar2015-08-226-0/+0
| | | | | | | | | With the earlier directory structure of examples/widgets, the speech examples would end up in the widgets directory along with other Qt Widgets examples in the Qt binary pkg. Change-Id: Ib9ad0826e23c493a4fc5b1d1e7acf9addad3be65 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Update license headersFrederik Gladhorn2015-05-123-12/+15
| | | | | Change-Id: I64edb68f78cd27e5f5071124252a53fcb3007d79 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Use new api in example to show age and gender in the ui.Jeremy Whiting2015-03-311-1/+3
| | | | | Change-Id: Id9f1f3f7da3f52df4343dffc8ac1bcb0dfb229fa Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Remove voiceType since it's not implemented in any backends.Jeremy Whiting2015-03-051-56/+27
| | | | | Change-Id: Iae76e27bbf64976bd6ac3ac07488128f93ce7b8e Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Add voice support with availableVoices, voice, and setVoice.Jeremy Whiting2014-11-123-64/+95
| | | | | | | | | | Add signal when voice changes, emit when voice is changed. In unix backend keep track of which voice names use which locale. Use locale name for QMultiMap key since QLocale keys aren't matching somehow. Add slot in example widget to update the locale when localeChanged is received. Change-Id: I455a7fbdf432d09929b36291f1fb1c673cf24503 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Fix buildFrederik Gladhorn2014-11-051-3/+3
| | | | | Change-Id: If41c4c23dddf4a8aca89f46ffd6edf0368989e6b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Fix copyrightFrederik Gladhorn2014-11-053-3/+3
| | | | | | Change-Id: Ieda0a7cd34f3c3a90a98c7c6a8930965b96a60ae Reviewed-by: Jeremy Whiting <jpwhiting@kde.org> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Make the example more touch friendlyFrederik Gladhorn2014-11-053-68/+110
| | | | | | Change-Id: I685bcc6a0bb600317ec8fe19c72753dbb4b8d728 Reviewed-by: Jeremy Whiting <jpwhiting@kde.org> Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Make example fit smaller device screensFrederik Gladhorn2014-11-051-7/+21
| | | | | | | | On iPods it's otherwise impossible to press the buttons. Change-Id: I879560dc6293b3dd14377e31c7b417edfdfb99fa Reviewed-by: Jeremy Whiting <jpwhiting@kde.org> Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Rename currentLocale to locale and make it a propertyFrederik Gladhorn2014-10-291-1/+1
| | | | | Change-Id: I4837954bc575e26aff8816b8b8d29d8370a00370 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Use new connect apiMontel Laurent2014-10-281-4/+4
| | | | | Change-Id: I552ae537d9f76e43902cd6967e63d91056786746 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Fix tab order and buddies in exampleFrederik Gladhorn2014-10-281-3/+18
| | | | | Change-Id: If5a74111e87889c4790ed0996a37e6f20b1ce0af Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Some fixupsFrederik Gladhorn2014-10-282-17/+11
| | | | | | | | Make the example work again, fix volume on OS X Change-Id: I7730213838666eba10317ccbe0b2a759192e829f Reviewed-by: Laurent Montel <laurent.montel@kdab.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Add locale setting and available locale getting methods to api.Jeremy Whiting2014-10-241-3/+12
| | | | | | | | | Implement new methods in unix backend. Add empty methods in other backends. Updated test widget application to use new api. Change-Id: I889f93574f91ce70b0571cb72a5d1041d8c5c720 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Rename QSpeech to QTextToSpeechFrederik Gladhorn2014-01-233-17/+17
| | | | | Change-Id: Iab0b7b3b4409c785c57ca015c4f3f4a0d7a49dc5 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Welcome Qt SpeechFrederik Gladhorn2014-01-207-0/+442