diff options
author | Nico Vertriest <nico.vertriest@qt.io> | 2020-08-17 07:26:01 +0200 |
---|---|---|
committer | Paul Wicking <paul.wicking@qt.io> | 2020-09-01 06:13:11 +0200 |
commit | e1915cd83e3b1abc0a7eec5e9917739ed512b459 (patch) | |
tree | a2c361f5ba785a2a38472525b2f05c205a4abd81 /src/gui/doc | |
parent | 37fbffee81be467fa5cee0ce83188e50c144947d (diff) |
Doc: Make snippets Qt Gui compilable - textblock-fragments
Task-number: QTBUG-81486
Change-Id: I3a6ee6ef744abb694d1cc7ef409f8bb584854395
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/gui/doc')
4 files changed, 19 insertions, 9 deletions
diff --git a/src/gui/doc/snippets/snippets.pro b/src/gui/doc/snippets/snippets.pro index 85876c15d4..079ffa7918 100644 --- a/src/gui/doc/snippets/snippets.pro +++ b/src/gui/doc/snippets/snippets.pro @@ -10,6 +10,7 @@ contains(QT_BUILD_PARTS, tests) { droparea \ qfontdatabase \ textblock-formats \ + textblock-fragments \ textdocument-blocks \ textdocument-charformats \ textdocument-css \ diff --git a/src/gui/doc/snippets/textblock-fragments/textblock-fragments.pro b/src/gui/doc/snippets/textblock-fragments/textblock-fragments.pro index 83ed78e573..b2fbea4fc3 100644 --- a/src/gui/doc/snippets/textblock-fragments/textblock-fragments.pro +++ b/src/gui/doc/snippets/textblock-fragments/textblock-fragments.pro @@ -1,6 +1,8 @@ -QT += xml -HEADERS = mainwindow.h \ - xmlwriter.h -SOURCES = main.cpp \ - mainwindow.cpp \ - xmlwriter.cpp +TEMPLATE = lib +TARGET = gui_snippets_textblock_fragments +QT += core gui widgets xml + +HEADERS = \ + xmlwriter.h +SOURCES = \ + xmlwriter.cpp diff --git a/src/gui/doc/snippets/textblock-fragments/xmlwriter.cpp b/src/gui/doc/snippets/textblock-fragments/xmlwriter.cpp index 1172b39847..96a2fdfb09 100644 --- a/src/gui/doc/snippets/textblock-fragments/xmlwriter.cpp +++ b/src/gui/doc/snippets/textblock-fragments/xmlwriter.cpp @@ -47,11 +47,10 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ - -#include <QtGui> - #include "xmlwriter.h" +#include <QTextDocument> + QDomDocument *XmlWriter::toXml() { QDomImplementation implementation; @@ -120,8 +119,15 @@ void XmlWriter::readFragment(const QTextBlock ¤tBlock, void XmlWriter::processBlock(const QTextBlock ¤tBlock) { + // Dummy use of specified parameter currentBlock + QTextBlock localBlock; + localBlock = currentBlock; + } void XmlWriter::processFragment(const QTextFragment ¤tFragment) { + // Dummy use of specified parameter currentFragment + QTextFragment localFragment; + localFragment = currentFragment; } diff --git a/src/gui/doc/snippets/textblock-fragments/xmlwriter.h b/src/gui/doc/snippets/textblock-fragments/xmlwriter.h index a9562e7c42..b140aa1c9b 100644 --- a/src/gui/doc/snippets/textblock-fragments/xmlwriter.h +++ b/src/gui/doc/snippets/textblock-fragments/xmlwriter.h @@ -52,6 +52,7 @@ #define XMLWRITER_H #include <QDomDocument> +#include <QTextBlock> class QTextDocument; |