summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-12-04 17:44:20 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-12-10 18:38:56 +0000
commitb688c7e99a8def9db836d1d6ab7388ae14a5d5b0 (patch)
tree85e7e18af6672087ecde71db3602a61e0c795fc3 /examples
parent8576354b885b345e3546f0ee5040980476487167 (diff)
DropSite example: fix documentation
The DropSite documentation mentioned the foreach keyword which was removed some times ago in the code. Therefore also remove the corresponding documentation snippet. Change-Id: Id9dd3f01dbdd37eeda43fabe12b60ef9e0b32d10 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/widgets/doc/dropsite.qdoc8
-rw-r--r--examples/widgets/draganddrop/dropsite/dropsitewindow.cpp3
2 files changed, 3 insertions, 8 deletions
diff --git a/examples/widgets/doc/dropsite.qdoc b/examples/widgets/doc/dropsite.qdoc
index 32bcfe8916..af8766a308 100644
--- a/examples/widgets/doc/dropsite.qdoc
+++ b/examples/widgets/doc/dropsite.qdoc
@@ -202,13 +202,7 @@
\snippet draganddrop/dropsite/dropsitewindow.cpp updateFormatsTable() part1
Once we are sure that \c mimeData is valid, we iterate through its
- supported formats using the \l{The foreach Keyword}{foreach keyword}.
- This keyword has the following format:
-
- \include code/doc_src_examples_dropsite.qdoc 0
-
- In our example, \c format is the \a variable and the \a container is a
- QStringList, obtained from \c mimeData->formats().
+ supported formats.
\note The \l{QMimeData::formats()}{formats()} function returns a
QStringList object, containing all the formats supported by the
diff --git a/examples/widgets/draganddrop/dropsite/dropsitewindow.cpp b/examples/widgets/draganddrop/dropsite/dropsitewindow.cpp
index 28a42ee614..2dae83bb22 100644
--- a/examples/widgets/draganddrop/dropsite/dropsitewindow.cpp
+++ b/examples/widgets/draganddrop/dropsite/dropsitewindow.cpp
@@ -113,7 +113,8 @@ void DropSiteWindow::updateFormatsTable(const QMimeData *mimeData)
//! [updateFormatsTable() part1]
//! [updateFormatsTable() part2]
- for (const QString &format : mimeData->formats()) {
+ const QStringList formats = mimeData->formats();
+ for (const QString &format : formats) {
QTableWidgetItem *formatItem = new QTableWidgetItem(format);
formatItem->setFlags(Qt::ItemIsEnabled);
formatItem->setTextAlignment(Qt::AlignTop | Qt::AlignLeft);