diff options
author | Michael Goddard <michael.goddard@nokia.com> | 2012-06-13 13:52:05 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-15 08:49:29 +0200 |
commit | 6931cbb35a909b192960205929d4a0efde280ee2 (patch) | |
tree | 84ca34a55756f929d255a887c12c01e69d101259 /doc/src/snippets | |
parent | e975897ad7ebbad12f023e83eae8c4b7840ad6ed (diff) |
Fix a number of other qdoc issues.
* Several places needed the forward class declaration hack
* Missing/wrong minor version numbers on imports
* A few typos
* Any number of attempts to work around qdoc
* A few missing docs
* Tweaked soundeffect docs
Change-Id: I3c2ab998a11cbb0956712e0423e01fdb70f5bfff
Reviewed-by: Peter Yard <peter.yard@nokia.com>
Reviewed-by: Angus Cummings <angus.cummings@nokia.com>
Reviewed-by: Jonas Rabbe <jonas.rabbe@gmail.com>
Diffstat (limited to 'doc/src/snippets')
-rw-r--r-- | doc/src/snippets/multimedia-snippets/qsound.cpp | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/doc/src/snippets/multimedia-snippets/qsound.cpp b/doc/src/snippets/multimedia-snippets/qsound.cpp index d17fecc50..3fdb63e19 100644 --- a/doc/src/snippets/multimedia-snippets/qsound.cpp +++ b/doc/src/snippets/multimedia-snippets/qsound.cpp @@ -38,8 +38,9 @@ ** ****************************************************************************/ - +#include "qobject.h" #include "qsound.h" +#include "qsoundeffect.h" void qsoundsnippet() { //! [0] @@ -52,3 +53,33 @@ void qsoundsnippet() { bells.play(); //! [1] } + +void qsoundeffectsnippet() { + //! [2] + QSoundEffect effect; + effect.setSource(QUrl::fromLocalFile("engine.wav")); + effect.setLoopCount(QSoundEffect::Infinite); + effect.setVolume(0.25f); + effect.play(); + //! [2] +} + +QObject *clickSource; + +class MyGame : public QObject { + Q_OBJECT +public: + //! [3] + MyGame() + : m_explosion(this) + { + m_explosion.setSource(QUrl::fromLocalFile("explosion.wav")); + m_explosion.setVolume(0.25f); + + // Set up click handling etc. + connect(clickSource, SIGNAL(clicked()), &m_explosion, SLOT(play())); + } +private: + QSoundEffect m_explosion; + //! [3] +}; |