summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorartoka <arto.katajasalo@digia.com>2011-12-13 14:20:30 +0200
committerQt Commercial Integration <QtCommercial@digia.com>2012-01-31 12:25:07 +0200
commit08e5e81d5ebece3eb3f489d438e2cea5d4adcb4f (patch)
treec775ae5728609a44a2ea2b579a2fb891189f7c4e
parentb10d3383b8dcfafae5adad2f373cc986cc3e66cf (diff)
Various qt documentation fixes (wk 43)
-rw-r--r--doc/src/porting/qt4-threads.qdoc4
-rw-r--r--doc/src/snippets/audio/audio.pro2
-rw-r--r--doc/src/snippets/audio/main.cpp123
-rw-r--r--doc/src/snippets/code/doc_src_qt4-arthur.cpp9
-rw-r--r--doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp2
-rw-r--r--doc/src/snippets/sqldatabase/sqldatabase.cpp2
-rw-r--r--src/corelib/global/qnamespace.qdoc2
-rw-r--r--src/corelib/io/qurl.cpp4
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.cpp2
-rw-r--r--src/corelib/kernel/qmetaobject.cpp25
-rw-r--r--src/corelib/kernel/qobject.cpp2
-rw-r--r--src/corelib/tools/qlocale.cpp1
-rw-r--r--src/corelib/tools/qregexp.cpp2
-rw-r--r--src/gui/dialogs/qabstractprintdialog.cpp4
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp6
-rw-r--r--src/gui/graphicsview/qgraphicslayout.cpp4
-rw-r--r--src/multimedia/audio/qaudiodeviceinfo.cpp4
-rw-r--r--src/multimedia/audio/qaudioinput.cpp45
-rw-r--r--src/multimedia/audio/qaudiooutput.cpp45
-rw-r--r--src/xml/dom/qdom.cpp2
20 files changed, 169 insertions, 121 deletions
diff --git a/doc/src/porting/qt4-threads.qdoc b/doc/src/porting/qt4-threads.qdoc
index 87182ea2ba..10cbbc1dca 100644
--- a/doc/src/porting/qt4-threads.qdoc
+++ b/doc/src/porting/qt4-threads.qdoc
@@ -57,8 +57,8 @@
specific thread. When a signal is emitted, the slot isn't called
immediately; instead, it is invoked when control returns to the
event loop of the thread to which the object belongs. The slot is
- executed in the thread where the receiver object lives. See
- QObject::connect() for details.
+ executed in the thread where the receiver object lives. See
+ \l{signals-and-slots-across-threads} and QObject::connect() for details.
Qt 4 also introduces a new synchronization class: QReadWriteLock.
It is similar to QMutex, except that it distinguishes between
diff --git a/doc/src/snippets/audio/audio.pro b/doc/src/snippets/audio/audio.pro
new file mode 100644
index 0000000000..cc02dc8fd5
--- /dev/null
+++ b/doc/src/snippets/audio/audio.pro
@@ -0,0 +1,2 @@
+QT += multimedia
+SOURCES += main.cpp
diff --git a/doc/src/snippets/audio/main.cpp b/doc/src/snippets/audio/main.cpp
index e3244cdb44..1e26b45b83 100644
--- a/doc/src/snippets/audio/main.cpp
+++ b/doc/src/snippets/audio/main.cpp
@@ -48,29 +48,71 @@ class Window2 : public QWidget
{
Q_OBJECT
-public slots:
+public:
+
+//![0]
+ void startRecording()
+ {
+ outputFile.setFileName("/tmp/test.raw");
+ outputFile.open( QIODevice::WriteOnly | QIODevice::Truncate );
+
+ QAudioFormat format;
+ // set up the format you want, eg.
+ format.setFrequency(8000);
+ format.setChannels(1);
+ format.setSampleSize(8);
+ format.setCodec("audio/pcm");
+ format.setByteOrder(QAudioFormat::LittleEndian);
+ format.setSampleType(QAudioFormat::UnSignedInt);
+
+ QAudioDeviceInfo info = QAudioDeviceInfo::defaultInputDevice();
+ if (!info.isFormatSupported(format)) {
+ qWarning()<<"default format not supported try to use nearest";
+ format = info.nearestFormat(format);
+ }
+
+ audioInput = new QAudioInput(format, this);
+ QTimer::singleShot(3000, this, SLOT(stopRecording()));
+ audioInput->start(&outputFile);
+ // Records audio for 3000ms
+ }
//![0]
+
+//![1]
+ void stopRecording()
+ {
+ audioInput->stop();
+ outputFile.close();
+ delete audioInput;
+ }
+//![1]
+
+public slots:
+//![2]
void stateChanged(QAudio::State newState)
{
switch(newState) {
- case QAudio::StopState:
- if (input->error() != QAudio::NoError) {
- // Error handling
+ case QAudio::StoppedState:
+ if (audioInput->error() != QAudio::NoError) {
+ // Perform error handling
} else {
}
break;
-//![0]
+//![2]
default:
;
}
}
private:
- QAudioInput *input;
-
+//![3]
+ QFile outputFile; // class member.
+ QAudioInput *audioInput; // class member.
+//![3]
};
+
class Window : public QWidget
{
Q_OBJECT
@@ -78,45 +120,86 @@ class Window : public QWidget
public:
Window()
{
- output = new QAudioOutput;
- connect(output, SIGNAL(stateChanged(QAudio::State)),
+ audioOutput = new QAudioOutput;
+ connect(audioOutput, SIGNAL(stateChanged(QAudio::State)),
this, SLOT(stateChanged(QAudio::State)));
}
+public:
+
+//![4]
+ void startPlaying()
+ {
+ inputFile.setFileName("/tmp/test.raw");
+ inputFile.open(QIODevice::ReadOnly);
+
+ QAudioFormat format;
+ // Set up the format, eg.
+ format.setFrequency(8000);
+ format.setChannels(1);
+ format.setSampleSize(8);
+ format.setCodec("audio/pcm");
+ format.setByteOrder(QAudioFormat::LittleEndian);
+ format.setSampleType(QAudioFormat::UnSignedInt);
+
+ QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());
+ if (!info.isFormatSupported(format)) {
+ qWarning()<<"raw audio format not supported by backend, cannot play audio.";
+ return;
+ }
+
+ audioOutput = new QAudioOutput(format, this);
+ connect(audioOutput,SIGNAL(stateChanged(QAudio::State)),SLOT(finishedPlaying(QAudio::State)));
+ audioOutput->start(&inputFile);
+ }
+//![4]
+
+//![5]
+ void finishedPlaying(QAudio::State state)
+ {
+ if(state == QAudio::IdleState) {
+ audioOutput->stop();
+ inputFile.close();
+ delete audioOutput;
+ }
+ }
+//![5]
+
private:
+
void setupFormat()
{
-//![1]
+//![6]
QAudioFormat format;
format.setFrequency(44100);
-//![1]
+//![6]
format.setChannels(2);
format.setSampleSize(16);
format.setCodec("audio/pcm");
format.setByteOrder(QAudioFormat::LittleEndian);
-//![2]
+//![7]
format.setSampleType(QAudioFormat::SignedInt);
QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());
if (!info.isFormatSupported(format))
format = info.nearestFormat(format);
-//![2]
+//![7]
}
public slots:
-//![3]
+//![8]
void stateChanged(QAudio::State newState)
{
switch (newState) {
- case QAudio::StopState:
- if (output->error() != QAudio::NoError) {
+ case QAudio::StoppedState:
+ if (audioOutput->error() != QAudio::NoError) {
// Perform error handling
} else {
// Normal stop
}
break;
-//![3]
+//![8]
// Handle
case QAudio::ActiveState:
@@ -129,7 +212,11 @@ public slots:
}
private:
- QAudioOutput *output;
+
+//![9]
+ QFile inputFile; // class member.
+ QAudioOutput *audioOutput; // class member.
+//![9]
};
int main(int argv, char **args)
diff --git a/doc/src/snippets/code/doc_src_qt4-arthur.cpp b/doc/src/snippets/code/doc_src_qt4-arthur.cpp
index 6268309db6..e52526966d 100644
--- a/doc/src/snippets/code/doc_src_qt4-arthur.cpp
+++ b/doc/src/snippets/code/doc_src_qt4-arthur.cpp
@@ -74,7 +74,7 @@ painter.drawEllipse(0, 0, 100, 100);
painter.setBrush(QColor(255, 0, 0, 127));
painter.drawRect(0, 0, width()/2, height());
-// Specify semi-transparend blue
+// Specify semi-transparent blue
painter.setBrush(QColor(0, 0, 255, 127));
painter.drawRect(0, 0, width(), height()/2);
//! [3]
@@ -86,15 +86,16 @@ painter.drawLine(0, 0, width()/2, height());
// One line with anti-aliasing
painter.setRenderHint(QPainter::Antialiasing);
-painter.drawLine(width()/2, 0, width()/2, height());
+painter.drawLine(width()/2, 0, width(), height());
//! [4]
//! [5]
QPainterPath path;
path.addRect(20, 20, 60, 60);
-path.addBezier(0, 0, 99, 0, 50, 50, 99, 99);
-path.addBezier(99, 99, 0, 99, 50, 50, 0, 0);
+path.moveTo(0, 0);
+path.cubicTo(99, 0, 50, 50, 99, 99);
+path.cubicTo(0, 99, 50, 50, 0, 0);
painter.drawPath(path);
//! [5]
diff --git a/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp b/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp
index 35e6feb523..1e78ed016a 100644
--- a/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp
+++ b/doc/src/snippets/code/src_corelib_kernel_qmetatype.cpp
@@ -73,7 +73,7 @@ MyStruct s2 = var.value<MyStruct>();
//! [3]
int id = QMetaType::type("MyClass");
-if (id == 0) {
+if (id != 0) {
void *myClassPtr = QMetaType::construct(id);
...
QMetaType::destroy(id, myClassPtr);
diff --git a/doc/src/snippets/sqldatabase/sqldatabase.cpp b/doc/src/snippets/sqldatabase/sqldatabase.cpp
index 4f428c7f5b..1f20884b92 100644
--- a/doc/src/snippets/sqldatabase/sqldatabase.cpp
+++ b/doc/src/snippets/sqldatabase/sqldatabase.cpp
@@ -284,12 +284,12 @@ void QSqlTableModel_snippets()
model->setTable("employee");
model->setEditStrategy(QSqlTableModel::OnManualSubmit);
model->select();
- model->removeColumn(0); // don't show the ID
model->setHeaderData(0, Qt::Horizontal, tr("Name"));
model->setHeaderData(1, Qt::Horizontal, tr("Salary"));
QTableView *view = new QTableView;
view->setModel(model);
+ view->hideColumn(0); // don't show the ID
view->show();
//! [24]
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 99f82fad22..ca81d703ff 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -514,7 +514,7 @@
When using signals and slots with multiple threads, see \l{Signals and Slots Across Threads}.
- \sa {Thread Support in Qt}, QObject::connect(), qRegisterMetaType()
+ \sa {Thread Support in Qt}, QObject::connect(), qRegisterMetaType(), Q_DECLARE_METATYPE()
*/
/*!
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index 3f49cc6969..24117a09c5 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -4128,6 +4128,7 @@ QString QUrlPrivate::createErrorString()
Constructs a URL by parsing \a url. \a url is assumed to be in human
readable representation, with no percent encoding. QUrl will automatically
percent encode all characters that are not allowed in a URL.
+ The default parsing mode is TolerantMode.
Example:
@@ -4148,7 +4149,8 @@ QUrl::QUrl(const QString &url) : d(0)
/*!
\overload
- Parses the \a url using the parser mode \a parsingMode.
+ Parses the \a url using the parser mode \a parsingMode.
+ The default parsing mode is TolerantMode.
\sa setUrl()
*/
diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp
index e0ee10eaaa..67e2502121 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.cpp
+++ b/src/corelib/kernel/qabstracteventdispatcher.cpp
@@ -230,7 +230,7 @@ void QAbstractEventDispatcherPrivate::releaseTimerId(int timerId)
QAbstractEventDispatcher also allows the integration of an
external event loop with the Qt event loop. For example, the
- \l{Qt Solutions}{Motif Extension Qt Solution} includes a
+ \l{ftp://ftp.qt.nokia.com/pub/qt/solutions/lgpl/qtmotifextension-2.7_1-opensource.tar.gz}{Motif Extension} includes a
reimplementation of QAbstractEventDispatcher that merges Qt and
Motif events together.
diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp
index 71f375f510..8e6f14eaf9 100644
--- a/src/corelib/kernel/qmetaobject.cpp
+++ b/src/corelib/kernel/qmetaobject.cpp
@@ -1337,7 +1337,30 @@ const char *QMetaMethod::typeName() const
Returns the tag associated with this method.
Tags are special macros recognized by \c moc that make it
- possible to add extra information about a method. For the moment,
+ possible to add extra information about a method.
+
+ Tag information can be added in the following
+ way in the function declaration:
+
+ \code
+ #define THISISTESTTAG // tag text
+ ...
+ private slots:
+ THISISTESTTAG void testFunc();
+ \endcode
+
+ and the information can be accessed by using:
+
+ \code
+ MainWindow win;
+ win.show();
+
+ int functionIndex = win.metaObject()->indexOfSlot("testFunc()");
+ QMetaMethod mm = metaObject()->method(functionIndex);
+ qDebug() << mm.tag(); // prints THISISTESTTAG
+ \endcode
+
+ For the moment,
\c moc doesn't support any special tags.
*/
const char *QMetaMethod::tag() const
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 57449bd48a..9261fefc1c 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -2453,7 +2453,7 @@ int QObject::receivers(const char *signal) const
call qRegisterMetaType() to register the data type before you
establish the connection.
- \sa disconnect(), sender(), qRegisterMetaType()
+ \sa disconnect(), sender(), qRegisterMetaType(), Q_DECLARE_METATYPE()
*/
bool QObject::connect(const QObject *sender, const char *signal,
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index 09c6d70414..5c5048b86a 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -2089,7 +2089,6 @@ QDataStream &operator>>(QDataStream &ds, QLocale &l)
\value Yugoslavia
\value Zambia
\value Zimbabwe
- \value SerbiaAndMontenegro
\value Montenegro
\value Serbia
\value SaintBarthelemy
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp
index 678f3d22c0..bfdcc338c6 100644
--- a/src/corelib/tools/qregexp.cpp
+++ b/src/corelib/tools/qregexp.cpp
@@ -424,7 +424,7 @@ int qFindString(const QChar *haystack, int haystackLen, int from,
For historical reasons, quantifiers (e.g. \bold{*}) that apply to
capturing parentheses are more "greedy" than other quantifiers.
- For example, \bold{a*(a)*} will match "aaa" with cap(1) == "aaa".
+ For example, \bold{a*(a*)} will match "aaa" with cap(1) == "aaa".
This behavior is different from what other regexp engines do
(notably, Perl). To obtain a more intuitive capturing behavior,
specify QRegExp::RegExp2 to the QRegExp constructor or call
diff --git a/src/gui/dialogs/qabstractprintdialog.cpp b/src/gui/dialogs/qabstractprintdialog.cpp
index 4b495d1132..6c9c61ebae 100644
--- a/src/gui/dialogs/qabstractprintdialog.cpp
+++ b/src/gui/dialogs/qabstractprintdialog.cpp
@@ -79,7 +79,7 @@ class QPrintDialogPrivate : public QAbstractPrintDialogPrivate
\value AllPages All pages should be printed.
\value Selection Only the selection should be printed.
\value PageRange The specified page range should be printed.
- \value CurrentPage Only the currently visible page should be printed.
+ \value CurrentPage Only the currently visible page should be printed. (This value was introduced in 4.7.)
\sa QPrinter::PrintRange
*/
@@ -95,7 +95,7 @@ class QPrintDialogPrivate : public QAbstractPrintDialogPrivate
\value PrintPageRange The page range selection option is enabled.
\value PrintShowPageSize Show the page size + margins page only if this is enabled.
\value PrintCollateCopies The collate copies option is enabled
- \value PrintCurrentPage The print current page option is enabled
+ \value PrintCurrentPage The print current page option is enabled (This value was introduced in 4.7.)
This value is obsolete and does nothing since Qt 4.5:
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 9e1fd094b1..abf9d44578 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -11050,9 +11050,9 @@ QGraphicsItemGroup::~QGraphicsItemGroup()
}
/*!
- Adds the given \a item to this item group. The item will be
- reparented to this group, but its position and transformation
- relative to the scene will stay intact.
+ Adds the given \a item and item's child items to this item group.
+ The item and child items will be reparented to this group,
+ but its position and transformation relative to the scene will stay intact.
\sa removeFromGroup(), QGraphicsScene::createItemGroup()
*/
diff --git a/src/gui/graphicsview/qgraphicslayout.cpp b/src/gui/graphicsview/qgraphicslayout.cpp
index f9839553bf..5f0883f4c5 100644
--- a/src/gui/graphicsview/qgraphicslayout.cpp
+++ b/src/gui/graphicsview/qgraphicslayout.cpp
@@ -102,6 +102,10 @@ QT_BEGIN_NAMESPACE
any way, but for a linear layout, the order is essential. When writing your own
layout subclass, you are free to choose the API that best suits your layout.
+ For adding layout items to the custom layout, the QGraphicsLayout provides
+ convenience function addChildLayoutItem(). The function will take care of
+ automatically reparenting graphics items, if needed.
+
\section1 Activating the Layout
When the layout's geometry changes, QGraphicsLayout immediately rearranges
diff --git a/src/multimedia/audio/qaudiodeviceinfo.cpp b/src/multimedia/audio/qaudiodeviceinfo.cpp
index 603c3888db..c46fa7f37a 100644
--- a/src/multimedia/audio/qaudiodeviceinfo.cpp
+++ b/src/multimedia/audio/qaudiodeviceinfo.cpp
@@ -114,9 +114,9 @@ public:
supported format that is as close as possible to the format with
nearestFormat(). For instance:
- \snippet doc/src/snippets/audio/main.cpp 1
+ \snippet doc/src/snippets/audio/main.cpp 6
\dots 8
- \snippet doc/src/snippets/audio/main.cpp 2
+ \snippet doc/src/snippets/audio/main.cpp 7
A QAudioDeviceInfo is used by Qt to construct
classes that communicate with the device--such as
diff --git a/src/multimedia/audio/qaudioinput.cpp b/src/multimedia/audio/qaudioinput.cpp
index e209dd1796..d22f66da02 100644
--- a/src/multimedia/audio/qaudioinput.cpp
+++ b/src/multimedia/audio/qaudioinput.cpp
@@ -76,37 +76,9 @@ QT_BEGIN_NAMESPACE
with a QIODevice opened for writing. For instance, to record to a
file, you can:
- \code
- QFile outputFile; // class member.
- QAudioInput* audio; // class member.
- \endcode
-
- \code
- {
- outputFile.setFileName("/tmp/test.raw");
- outputFile.open( QIODevice::WriteOnly | QIODevice::Truncate );
-
- QAudioFormat format;
- // set up the format you want, eg.
- format.setFrequency(8000);
- format.setChannels(1);
- format.setSampleSize(8);
- format.setCodec("audio/pcm");
- format.setByteOrder(QAudioFormat::LittleEndian);
- format.setSampleType(QAudioFormat::UnSignedInt);
-
- QAudioDeviceInfo info = QAudioDeviceInfo::defaultInputDevice();
- if (!info.isFormatSupported(format)) {
- qWarning()<<"default format not supported try to use nearest";
- format = info.nearestFormat(format);
- }
-
- audio = new QAudioInput(format, this);
- QTimer::singleShot(3000, this, SLOT(stopRecording()));
- audio->start(&outputFile);
- // Records audio for 3000ms
- }
- \endcode
+ \snippet doc/src/snippets/audio/main.cpp 3
+ \dots 4
+ \snippet doc/src/snippets/audio/main.cpp 0
This will start recording if the format specified is supported by
the input device (you can check this with
@@ -114,14 +86,7 @@ QT_BEGIN_NAMESPACE
snags, use the error() function to check what went wrong. We stop
recording in the \c stopRecording() slot.
- \code
- void stopRecording()
- {
- audio->stop();
- outputFile->close();
- delete audio;
- }
- \endcode
+ \snippet doc/src/snippets/audio/main.cpp 1
At any point in time, QAudioInput will be in one of four states:
active, suspended, stopped, or idle. These states are specified by
@@ -143,7 +108,7 @@ QT_BEGIN_NAMESPACE
an error is encountered. Connect to the stateChanged() signal to
handle the error:
- \snippet doc/src/snippets/audio/main.cpp 0
+ \snippet doc/src/snippets/audio/main.cpp 2
\sa QAudioOutput, QAudioDeviceInfo
diff --git a/src/multimedia/audio/qaudiooutput.cpp b/src/multimedia/audio/qaudiooutput.cpp
index 1abdc585f3..5420574ed6 100644
--- a/src/multimedia/audio/qaudiooutput.cpp
+++ b/src/multimedia/audio/qaudiooutput.cpp
@@ -72,35 +72,9 @@ QT_BEGIN_NAMESPACE
needs from the io device. So playing back an audio file is as
simple as:
- \code
- QFile inputFile; // class member.
- QAudioOutput* audio; // class member.
- \endcode
-
- \code
- inputFile.setFileName("/tmp/test.raw");
- inputFile.open(QIODevice::ReadOnly);
-
- QAudioFormat format;
- // Set up the format, eg.
- format.setFrequency(8000);
- format.setChannels(1);
- format.setSampleSize(8);
- format.setCodec("audio/pcm");
- format.setByteOrder(QAudioFormat::LittleEndian);
- format.setSampleType(QAudioFormat::UnSignedInt);
-
- QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());
- if (!info.isFormatSupported(format)) {
- qWarning()<<"raw audio format not supported by backend, cannot play audio.";
- return;
- }
-
- audio = new QAudioOutput(format, this);
- connect(audio,SIGNAL(stateChanged(QAudio::State)),SLOT(finishedPlaying(QAudio::State)));
- audio->start(&inputFile);
-
- \endcode
+ \snippet doc/src/snippets/audio/main.cpp 9
+ \dots 4
+ \snippet doc/src/snippets/audio/main.cpp 4
The file will start playing assuming that the audio system and
output device support it. If you run out of luck, check what's
@@ -108,16 +82,7 @@ QT_BEGIN_NAMESPACE
After the file has finished playing, we need to stop the device:
- \code
- void finishedPlaying(QAudio::State state)
- {
- if(state == QAudio::IdleState) {
- audio->stop();
- inputFile.close();
- delete audio;
- }
- }
- \endcode
+ \snippet doc/src/snippets/audio/main.cpp 5
At any given time, the QAudioOutput will be in one of four states:
active, suspended, stopped, or idle. These states are described
@@ -145,7 +110,7 @@ QT_BEGIN_NAMESPACE
You can check for errors by connecting to the stateChanged()
signal:
- \snippet doc/src/snippets/audio/main.cpp 3
+ \snippet doc/src/snippets/audio/main.cpp 8
\sa QAudioInput, QAudioDeviceInfo
*/
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 7c7cafc1a0..db5306ee42 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -2959,7 +2959,7 @@ QDomElement QDomNode::firstChildElement(const QString &tagName) const
/*!
Returns the last child element with tag name \a tagName if tagName is non-empty;
- otherwise returns the first child element. Returns a null element if no
+ otherwise returns the last child element. Returns a null element if no
such child exists.
\sa firstChildElement() previousSiblingElement() nextSiblingElement()