From b6043dc34e8156f4ba74b3fb7be0e62aff1364af Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Mon, 17 Aug 2020 06:38:38 +0200 Subject: [PATCH] Doc: Make snippets Qt Gui compilable - textblock-formats MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTGUI-81486 Change-Id: I06dd6ce04b4d37c49df07d4b1b47c3ef029ee419 Reviewed-by: Topi Reiniƶ --- src/gui/doc/snippets/snippets.pro | 1 + src/gui/doc/snippets/textblock-formats/main.cpp | 6 +++--- .../doc/snippets/textblock-formats/textblock-formats.pro | 8 ++++++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/gui/doc/snippets/snippets.pro b/src/gui/doc/snippets/snippets.pro index 6ede3d94ed..85876c15d4 100644 --- a/src/gui/doc/snippets/snippets.pro +++ b/src/gui/doc/snippets/snippets.pro @@ -9,6 +9,7 @@ contains(QT_BUILD_PARTS, tests) { draganddrop \ droparea \ qfontdatabase \ + textblock-formats \ textdocument-blocks \ textdocument-charformats \ textdocument-css \ diff --git a/src/gui/doc/snippets/textblock-formats/main.cpp b/src/gui/doc/snippets/textblock-formats/main.cpp index daa8f67f8b..ec3075c2e3 100644 --- a/src/gui/doc/snippets/textblock-formats/main.cpp +++ b/src/gui/doc/snippets/textblock-formats/main.cpp @@ -47,15 +47,15 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - -#include +#include +#include QString tr(const char *text) { return QApplication::translate(text, text); } -int main(int argc, char *argv[]) +int main_textblock_formats(int argc, char *argv[]) { QApplication app(argc, argv); diff --git a/src/gui/doc/snippets/textblock-formats/textblock-formats.pro b/src/gui/doc/snippets/textblock-formats/textblock-formats.pro index d664835b09..e7f408716f 100644 --- a/src/gui/doc/snippets/textblock-formats/textblock-formats.pro +++ b/src/gui/doc/snippets/textblock-formats/textblock-formats.pro @@ -1,2 +1,6 @@ -QT += xml -SOURCES = main.cpp +TEMPLATE = lib +TARGET = gui_snippets_textblock_formats +QT += core gui widgets + +SOURCES = \ + main.cpp