From 6283f447cd06ea71c73225db59f9173b0a2f06ef Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Sat, 29 Aug 2020 13:26:07 +0200 Subject: [PATCH] Doc: Make snippets Qt Gui compilable - textdocument-frames MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-81486 Change-Id: Ia027d2f07e61944e8a2cc40a24ee23b2d8e526b0 Reviewed-by: Topi Reiniƶ --- src/gui/doc/snippets/textdocument-frames/main.cpp | 4 +--- .../doc/snippets/textdocument-frames/mainwindow.h | 2 +- .../textdocument-frames/textdocument-frames.pro | 13 ++++++++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/gui/doc/snippets/textdocument-frames/main.cpp b/src/gui/doc/snippets/textdocument-frames/main.cpp index d5ee759b8f..ff3f70192c 100644 --- a/src/gui/doc/snippets/textdocument-frames/main.cpp +++ b/src/gui/doc/snippets/textdocument-frames/main.cpp @@ -47,10 +47,8 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - -#include - #include "mainwindow.h" +#include int main(int argc, char *argv[]) { diff --git a/src/gui/doc/snippets/textdocument-frames/mainwindow.h b/src/gui/doc/snippets/textdocument-frames/mainwindow.h index d4f41c81c0..941138d0e9 100644 --- a/src/gui/doc/snippets/textdocument-frames/mainwindow.h +++ b/src/gui/doc/snippets/textdocument-frames/mainwindow.h @@ -68,7 +68,7 @@ public slots: private: bool writeXml(const QString &fileName); - QTextEdit *editor; + QTextEdit *editor = nullptr; }; #endif diff --git a/src/gui/doc/snippets/textdocument-frames/textdocument-frames.pro b/src/gui/doc/snippets/textdocument-frames/textdocument-frames.pro index 12a900a7c6..c701a69e04 100644 --- a/src/gui/doc/snippets/textdocument-frames/textdocument-frames.pro +++ b/src/gui/doc/snippets/textdocument-frames/textdocument-frames.pro @@ -1,3 +1,10 @@ -SOURCES = main.cpp \ - mainwindow.cpp -HEADERS = mainwindow.h +TEMPLATE = lib +TARGET = textdocument-frames_snippets +QT += core gui widgets + +HEADERS = \ + mainwindow.h + +SOURCES = \ + mainwindow.cpp \ + main.cpp