summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Vertriest <nico.vertriest@qt.io>2020-08-29 13:26:07 +0200
committerPaul Wicking <paul.wicking@qt.io>2020-09-01 06:13:02 +0200
commit6283f447cd06ea71c73225db59f9173b0a2f06ef (patch)
tree63f753a5edc4c6bac7b78589ac9cbf214a491ba1
parentb28870b2cc328d4b45c838c377ffc607e5a12b6b (diff)
Doc: Make snippets Qt Gui compilable - textdocument-frames
Task-number: QTBUG-81486 Change-Id: Ia027d2f07e61944e8a2cc40a24ee23b2d8e526b0 Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
-rw-r--r--src/gui/doc/snippets/textdocument-frames/main.cpp4
-rw-r--r--src/gui/doc/snippets/textdocument-frames/mainwindow.h2
-rw-r--r--src/gui/doc/snippets/textdocument-frames/textdocument-frames.pro13
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 <QtGui>
-
#include "mainwindow.h"
+#include <QApplication>
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