From e28b65f868d3f3fe430208dc29bfb9982e82ef48 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Fri, 26 Feb 2021 14:21:48 +0100 Subject: Doc: Fix various documentation issues - Document QIODeviceBase - Document QPointerEvent::points - Fix linking issues Task-number: QTBUG-90662 Change-Id: Ib123d5708953b22e01f95c82626b39a49fff95b2 Reviewed-by: Nico Vertriest (cherry picked from commit 00e10f62b55626097e94a2d70a9214c0062fbcd5) --- examples/widgets/doc/src/addressbook-tutorial.qdoc | 6 +++--- src/corelib/io/qiodevice.cpp | 12 ++++++++++-- src/corelib/tools/qmargins.cpp | 3 +-- src/gui/image/qimagereader.cpp | 4 ++-- src/gui/kernel/qevent.cpp | 6 ++++++ src/gui/text/qtextdocumentwriter.cpp | 5 +++-- 6 files changed, 25 insertions(+), 11 deletions(-) diff --git a/examples/widgets/doc/src/addressbook-tutorial.qdoc b/examples/widgets/doc/src/addressbook-tutorial.qdoc index 563b6a2be9..53acb82b1a 100644 --- a/examples/widgets/doc/src/addressbook-tutorial.qdoc +++ b/examples/widgets/doc/src/addressbook-tutorial.qdoc @@ -842,7 +842,7 @@ If \c fileName is not empty, we create a QFile object, \c file, with \c fileName. QFile works with QDataStream as QFile is a QIODevice. - Next, we attempt to open the file in \l{QIODevice::}{WriteOnly} mode. + Next, we attempt to open the file in \l{QIODeviceBase::}{WriteOnly} mode. If this is unsuccessful, we display a QMessageBox to inform the user. \snippet tutorials/addressbook/part6/addressbook.cpp saveToFile() function part2 @@ -869,7 +869,7 @@ \image addressbook-tutorial-part6-load.png If \c fileName is not empty, again, we use a QFile object, \c file, and - attempt to open it in \l{QIODevice::}{ReadOnly} mode. Similar to our + attempt to open it in \l{QIODeviceBase::}{ReadOnly} mode. Similar to our implementation of \c saveToFile(), if this attempt is unsuccessful, we display a QMessageBox to inform the user. @@ -939,7 +939,7 @@ choose a location for the file. Using the file name chosen, we create an instance of QFile to write to. - We attempt to open the file in \l{QIODevice::}{WriteOnly} mode. If this + We attempt to open the file in \l{QIODeviceBase::}{WriteOnly} mode. If this process fails, we display a QMessageBox to inform the user about the problem and return. Otherwise, we pass the file as a parameter to a QTextStream object, \c out. Like QDataStream, the QTextStream class diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp index 5c8c0e6a27..0bea68acc5 100644 --- a/src/corelib/io/qiodevice.cpp +++ b/src/corelib/io/qiodevice.cpp @@ -289,11 +289,19 @@ QIODevicePrivate::~QIODevicePrivate() \sa QBuffer, QFile, QTcpSocket */ +/*! + \class QIODeviceBase + \inheaderfile QIODevice + \inmodule QtCore + \brief Base class for QIODevice that provides flags describing the mode in + which a device is opened. +*/ + /*! \enum QIODeviceBase::OpenModeFlag - This enum is used with open() to describe the mode in which a device - is opened. It is also returned by openMode(). + This enum is used with QIODevice::open() to describe the mode in which a + device is opened. It is also returned by QIODevice::openMode(). \value NotOpen The device is not open. \value ReadOnly The device is open for reading. diff --git a/src/corelib/tools/qmargins.cpp b/src/corelib/tools/qmargins.cpp index 5b3c04d11e..8a6e50ca24 100644 --- a/src/corelib/tools/qmargins.cpp +++ b/src/corelib/tools/qmargins.cpp @@ -508,10 +508,9 @@ QDebug operator<<(QDebug dbg, const QMargins &m) Returns \c true if all margins are very close to 0; otherwise returns false. - \sa qFuzzyIsNull + \sa {::}{qFuzzyIsNull} */ - /*! \fn qreal QMarginsF::left() const diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index 611cbb1df1..fccf67b428 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -769,7 +769,7 @@ bool QImageReader::decideFormatFromContent() const otherwise left unchanged. If the device is not already open, QImageReader will attempt to - open the device in \l QIODevice::ReadOnly mode by calling + open the device in \l {QIODeviceBase::}{ReadOnly} mode by calling open(). Note that this does not work for certain devices, such as QProcess, QTcpSocket and QUdpSocket, where more logic is required to open the device. @@ -799,7 +799,7 @@ QIODevice *QImageReader::device() const /*! Sets the file name of QImageReader to \a fileName. Internally, QImageReader will create a QFile object and open it in \l - QIODevice::ReadOnly mode, and use this when reading images. + {QIODeviceBase::}{ReadOnly} mode, and use this when reading images. If \a fileName does not include a file extension (e.g., .png or .bmp), QImageReader will cycle through all supported extensions until it finds diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index edf00928eb..adc1029754 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -252,6 +252,12 @@ QInputEvent::~QInputEvent() Returns a QEventPoint reference for the point at index \a i. */ +/*! + \fn const QList &QPointerEvent::points() const + + Returns a list of points in this pointer event. +*/ + /*! \fn QPointingDevice::PointerType QPointerEvent::pointerType() const diff --git a/src/gui/text/qtextdocumentwriter.cpp b/src/gui/text/qtextdocumentwriter.cpp index 31dfb9436f..74db049aa6 100644 --- a/src/gui/text/qtextdocumentwriter.cpp +++ b/src/gui/text/qtextdocumentwriter.cpp @@ -182,7 +182,7 @@ QByteArray QTextDocumentWriter::format () const unchanged. If the device is not already open, QTextDocumentWriter will attempt to - open the device in \l QIODevice::WriteOnly mode by calling open(). + open the device in \l {QIODeviceBase::}{WriteOnly} mode by calling open(). \note This will not work for certain devices, such as QProcess, QTcpSocket and QUdpSocket, where some configuration is required before @@ -211,7 +211,8 @@ QIODevice *QTextDocumentWriter::device () const /*! Sets the name of the file to be written to \a fileName. Internally, QTextDocumentWriter will create a QFile and open it in \l - QIODevice::WriteOnly mode, and use this file when writing the document. + {QIODeviceBase::}{WriteOnly} mode, and use this file when writing the + document. \sa fileName(), setDevice() */ -- cgit v1.2.3