From 2be708b801e116029492fda0d5435fc04fe783fd Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 4 Aug 2020 09:29:40 +0200 Subject: [PATCH] Doc: Make snippets Qt Gui compilable - textdocument-imagedrop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-81486 Change-Id: I80b66fce31ba5ee511690283cf56ce4306702b14 Reviewed-by: Topi Reiniƶ --- src/gui/doc/snippets/snippets.pro | 4 +++- src/gui/doc/snippets/textdocument-imagedrop/main.cpp | 9 ++++----- .../textdocument-imagedrop/textdocument-imagedrop.pro | 10 ++++++++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/gui/doc/snippets/snippets.pro b/src/gui/doc/snippets/snippets.pro index 4a004d5781..03a3f10fdb 100644 --- a/src/gui/doc/snippets/snippets.pro +++ b/src/gui/doc/snippets/snippets.pro @@ -13,5 +13,7 @@ contains(QT_BUILD_PARTS, tests) { textdocument-css \ textdocument-cursors \ textdocument-end \ - textdocument-find + textdocument-find \ + textdocument-frames \ + textdocument-imagedrop } diff --git a/src/gui/doc/snippets/textdocument-imagedrop/main.cpp b/src/gui/doc/snippets/textdocument-imagedrop/main.cpp index 198555c579..c7f7e2df45 100644 --- a/src/gui/doc/snippets/textdocument-imagedrop/main.cpp +++ b/src/gui/doc/snippets/textdocument-imagedrop/main.cpp @@ -47,16 +47,15 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - -#include #include "textedit.h" +#include int main(int argc, char * argv[]) { QApplication app(argc, argv); - TextEdit *textEdit = new TextEdit; - textEdit->show(); + TextEdit textEdit; + textEdit.show(); return app.exec(); -} \ No newline at end of file +} diff --git a/src/gui/doc/snippets/textdocument-imagedrop/textdocument-imagedrop.pro b/src/gui/doc/snippets/textdocument-imagedrop/textdocument-imagedrop.pro index 96d3038a09..5f1c55f038 100644 --- a/src/gui/doc/snippets/textdocument-imagedrop/textdocument-imagedrop.pro +++ b/src/gui/doc/snippets/textdocument-imagedrop/textdocument-imagedrop.pro @@ -1,2 +1,8 @@ -SOURCES = textedit.cpp main.cpp -HEADERS = textedit.h \ No newline at end of file +TEMPLATE = lib +TARGET = textdocument-imagedrop +QT += core gui widgets + +HEADERS = \ + textedit.h +SOURCES = \ + main.cpp