Doc: Fix documentation issues

The Qt Widgets Application example was moved to manual tests,
and no longer contains the snippet identifiers. Fix \snippet
and \quotefile commands to quote similar code snippets from
other examples or snippet files.

Fix also the following documentation warnings:

* No such parameter 'parsingMode' in QUrl::fromEncoded()
* Missing image: rsslisting.cpp

Change-Id: Ibc989e83abc49837db08628facaf8e5f72b2f123
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 17ddf2a6a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Topi Reinio 2023-06-09 14:04:38 +00:00 committed by Qt Cherry-pick Bot
parent 4f9b22fd00
commit 2e55a34c1c
8 changed files with 14 additions and 11 deletions

View File

@ -24,7 +24,7 @@
the parsed content may start in one chunk of data but not be completed until
a later chunk, requiring the parser to retain state between calls.
\image rsslisting.cpp
\image rsslisting.png
The main program is fairly minimal. It simply instantiates a \l QApplication
and the \c RSSListing widget, shows the latter and hands over control to the

View File

@ -279,6 +279,7 @@ void MainWindow::createActions()
fileMenu->addAction(newAct);
fileToolBar->addAction(newAct);
//! [qaction setup]
const QIcon openIcon = QIcon::fromTheme("document-open", QIcon(":/images/open.png"));
QAction *openAct = new QAction(openIcon, tr("&Open..."), this);
openAct->setShortcuts(QKeySequence::Open);
@ -286,6 +287,7 @@ void MainWindow::createActions()
connect(openAct, &QAction::triggered, this, &MainWindow::open);
fileMenu->addAction(openAct);
fileToolBar->addAction(openAct);
//! [qaction setup]
const QIcon saveIcon = QIcon::fromTheme("document-save", QIcon(":/images/save.png"));
saveAct = new QAction(saveIcon, tr("&Save"), this);

View File

@ -116,6 +116,7 @@ TextEdit::TextEdit(QWidget *parent)
#endif
}
//! [closeevent]
void TextEdit::closeEvent(QCloseEvent *e)
{
if (maybeSave())
@ -123,6 +124,7 @@ void TextEdit::closeEvent(QCloseEvent *e)
else
e->ignore();
}
//! [closeevent]
void TextEdit::setupFileActions()
{

View File

@ -2,9 +2,9 @@ TEMPLATE = app
QT += qml widgets
#! [0]
#! [0] #! [qrc]
RESOURCES = application.qrc
#! [0]
#! [0] #! [qrc]
#! [1]
resources.files = \

View File

@ -52,7 +52,7 @@
Here's an example \c .qrc file:
\quotefile resource-system/mainwindow.qrc
\quotefile resource-system/application.qrc
Each \c <file> element in the XML identifies a file in the application's
source tree. The path is resolved relative to the directory containing
@ -102,7 +102,7 @@
variable. If you add a \c .qrc file path to the variable, the listed
resource files will be embedded into the generated library or executable:
\snippet resource-system/mainwindow.pro qrc
\snippet resource-system/application.pro qrc
This creates a resource of several \c{.png} files, that are addressable
like this: \c{":/res/titlebarLeft.png"}.

View File

@ -2973,7 +2973,7 @@ QByteArray QUrl::toEncoded(FormattingOptions options) const
Parses \a input and returns the corresponding QUrl. \a input is
assumed to be in encoded form, containing only ASCII characters.
Parses the URL using \a parsingMode. See setUrl() for more information on
Parses the URL using \a mode. See setUrl() for more information on
this parameter. QUrl::DecodedMode is not permitted in this context.
\sa toEncoded(), setUrl()

View File

@ -173,7 +173,7 @@ QObject *QActionPrivate::menu() const
menu and toolbar, then connected to the slot which will perform
the action. For example:
\snippet ../widgets/mainwindows/application/mainwindow.cpp 19
\snippet ../widgets/mainwindows/mdi/mainwindow.cpp qaction setup
Actions are added to widgets using QWidget::addAction() or
QGraphicsWidget::addAction(). Note that an action must be added to a

View File

@ -9888,13 +9888,12 @@ void QWidget::actionEvent(QActionEvent *)
Main window applications typically use reimplementations of this function to check
whether the user's work has been saved and ask for permission before closing.
For example, the \l{Qt Widgets - Application Example} uses a helper function to
For example, the \l{Text Edit} example uses a helper function to
determine whether or not to close the window:
\snippet mainwindows/application/mainwindow.cpp 3
\snippet mainwindows/application/mainwindow.cpp 4
\snippet richtext/textedit/textedit.cpp closeevent
\sa event(), hide(), close(), QCloseEvent, {Qt Widgets - Application Example}
\sa event(), hide(), close(), QCloseEvent
*/
void QWidget::closeEvent(QCloseEvent *event)