From 886cc0e4428054fb3fd5cf2ce20bc52f41f56a9a Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Mon, 3 Aug 2020 15:01:58 +0200 Subject: [PATCH] Doc: Make snippets Qt Gui compilable - textdocument-blocks Task-number: QTBUG-81486 Change-Id: I663c53d11e4bd3086c4afee0c994d00ecc0c7cad Reviewed-by: Volker Hilsheimer --- src/gui/doc/snippets/snippets.pro | 1 + .../doc/snippets/textdocument-blocks/main.cpp | 7 ++++--- .../textdocument-blocks/textdocument-blocks.pro | 16 ++++++++++------ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/gui/doc/snippets/snippets.pro b/src/gui/doc/snippets/snippets.pro index fea4819ece3..20320228f65 100644 --- a/src/gui/doc/snippets/snippets.pro +++ b/src/gui/doc/snippets/snippets.pro @@ -8,5 +8,6 @@ contains(QT_BUILD_PARTS, tests) { code \ draganddrop \ qfontdatabase \ + textdocument-blocks \ textdocument-end } diff --git a/src/gui/doc/snippets/textdocument-blocks/main.cpp b/src/gui/doc/snippets/textdocument-blocks/main.cpp index 60afcac7b55..fb3bb2b2e9f 100644 --- a/src/gui/doc/snippets/textdocument-blocks/main.cpp +++ b/src/gui/doc/snippets/textdocument-blocks/main.cpp @@ -51,12 +51,13 @@ #include #include "mainwindow.h" +#include int main(int argc, char *argv[]) { QApplication app(argc, argv); - MainWindow *window = new MainWindow; - window->resize(640, 480); - window->show(); + MainWindow window; + window.resize(640, 480); + window.show(); return app.exec(); } diff --git a/src/gui/doc/snippets/textdocument-blocks/textdocument-blocks.pro b/src/gui/doc/snippets/textdocument-blocks/textdocument-blocks.pro index 83ed78e573f..3b45ba9cb2c 100644 --- a/src/gui/doc/snippets/textdocument-blocks/textdocument-blocks.pro +++ b/src/gui/doc/snippets/textdocument-blocks/textdocument-blocks.pro @@ -1,6 +1,10 @@ -QT += xml -HEADERS = mainwindow.h \ - xmlwriter.h -SOURCES = main.cpp \ - mainwindow.cpp \ - xmlwriter.cpp +TEMPLATE = lib +TARGET = textdocument-blocks_snippets +QT += core gui widgets + +HEADERS = \ + mainwindow.h + +SOURCES = \ + main.cpp \ + mainwindow.cpp