diff options
Diffstat (limited to 'examples/widgets/draganddrop/dropsite/droparea.cpp')
-rw-r--r-- | examples/widgets/draganddrop/dropsite/droparea.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/widgets/draganddrop/dropsite/droparea.cpp b/examples/widgets/draganddrop/dropsite/droparea.cpp index 886bfd6890..19644ed573 100644 --- a/examples/widgets/draganddrop/dropsite/droparea.cpp +++ b/examples/widgets/draganddrop/dropsite/droparea.cpp @@ -93,6 +93,9 @@ void DropArea::dropEvent(QDropEvent *event) //! [dropEvent() function part2] if (mimeData->hasImage()) { setPixmap(qvariant_cast<QPixmap>(mimeData->imageData())); + } else if (mimeData->hasFormat(QLatin1String("text/markdown"))) { + setText(QString::fromUtf8(mimeData->data(QLatin1String("text/markdown")))); + setTextFormat(Qt::MarkdownText); } else if (mimeData->hasHtml()) { setText(mimeData->html()); setTextFormat(Qt::RichText); |