diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/widgets/doc/dropsite.qdoc | 8 | ||||
-rw-r--r-- | examples/widgets/draganddrop/dropsite/dropsitewindow.cpp | 3 |
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); |