From b1e739b52416852014ee7a933aac81a28a9ac71f Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Wed, 24 Oct 2012 15:51:15 +0200 Subject: [PATCH] Qt GUI: Adding Rich Text Processing documentation from qtdoc -included the snippets -editing for technical accuracy still to be done. -ported missing files from Qt 4 Change-Id: I0b2d27630b762c6518c08973a40b476d7852001d Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/doc/images/plaintext-layout.png | Bin 0 -> 46384 bytes src/gui/doc/images/richtext-document.png | Bin 0 -> 8126 bytes src/gui/doc/snippets/code/doc_src_richtext.cpp | 85 ++ src/gui/doc/snippets/code/doc_src_richtext.qdoc | 43 + src/gui/doc/snippets/plaintextlayout/main.cpp | 52 + .../snippets/plaintextlayout/plaintextlayout.pro | 3 + src/gui/doc/snippets/plaintextlayout/window.cpp | 108 ++ src/gui/doc/snippets/plaintextlayout/window.h | 61 + src/gui/doc/snippets/scribe-overview/main.cpp | 73 ++ .../snippets/scribe-overview/scribe-overview.pro | 1 + src/gui/doc/snippets/textblock-formats/main.cpp | 118 ++ .../textblock-formats/textblock-formats.pro | 2 + src/gui/doc/snippets/textblock-fragments/main.cpp | 52 + .../snippets/textblock-fragments/mainwindow.cpp | 148 +++ .../doc/snippets/textblock-fragments/mainwindow.h | 65 ++ .../textblock-fragments/textblock-fragments.pro | 6 + .../doc/snippets/textblock-fragments/xmlwriter.h | 64 ++ src/gui/doc/snippets/textdocument-blocks/main.cpp | 52 + .../snippets/textdocument-blocks/mainwindow.cpp | 156 +++ .../doc/snippets/textdocument-blocks/mainwindow.h | 65 ++ .../textdocument-blocks/textdocument-blocks.pro | 6 + .../doc/snippets/textdocument-blocks/xmlwriter.cpp | 84 ++ .../doc/snippets/textdocument-blocks/xmlwriter.h | 61 + .../doc/snippets/textdocument-charformats/main.cpp | 92 ++ .../textdocument-charformats.pro | 1 + src/gui/doc/snippets/textdocument-cursors/main.cpp | 79 ++ .../textdocument-cursors/textdocument-cursors.pro | 1 + src/gui/doc/snippets/textdocument-find/main.cpp | 91 ++ .../textdocument-find/textdocument-find.pro | 1 + src/gui/doc/snippets/textdocument-frames/main.cpp | 53 + .../snippets/textdocument-frames/mainwindow.cpp | 161 +++ .../doc/snippets/textdocument-frames/mainwindow.h | 64 ++ .../textdocument-frames/textdocument-frames.pro | 6 + .../doc/snippets/textdocument-frames/xmlwriter.cpp | 118 ++ .../doc/snippets/textdocument-frames/xmlwriter.h | 64 ++ .../doc/snippets/textdocument-imagedrop/main.cpp | 52 + .../textdocument-imagedrop.pro | 2 + .../doc/snippets/textdocument-imagedrop/textedit.h | 56 + .../snippets/textdocument-imageformat/images.qrc | 6 + .../textdocument-imageformat/images/advert.png | Bin 0 -> 16291 bytes .../textdocument-imageformat/images/newimage.png | Bin 0 -> 5490 bytes .../doc/snippets/textdocument-imageformat/main.cpp | 98 ++ .../textdocument-imageformat.pro | 2 + .../doc/snippets/textdocument-images/images.qrc | 5 + .../snippets/textdocument-images/images/advert.png | Bin 0 -> 16291 bytes src/gui/doc/snippets/textdocument-images/main.cpp | 72 ++ .../textdocument-images/textdocument-images.pro | 2 + .../doc/snippets/textdocument-listitems/main.cpp | 52 + .../snippets/textdocument-listitems/mainwindow.cpp | 197 ++++ .../snippets/textdocument-listitems/mainwindow.h | 75 ++ .../textdocument-listitems.pro | 3 + .../doc/snippets/textdocument-printing/main.cpp | 52 + .../snippets/textdocument-printing/mainwindow.cpp | 124 ++ .../snippets/textdocument-printing/mainwindow.h | 72 ++ .../textdocument-printing.pro | 3 + .../doc/snippets/textdocument-selections/main.cpp | 52 + .../textdocument-selections/mainwindow.cpp | 203 ++++ .../snippets/textdocument-selections/mainwindow.h | 79 ++ .../textdocument-selections.pro | 4 + src/gui/doc/snippets/textdocument-tables/main.cpp | 52 + .../doc/snippets/textdocument-tables/mainwindow.h | 65 ++ .../textdocument-tables/textdocument-tables.pro | 6 + .../doc/snippets/textdocument-tables/xmlwriter.cpp | 155 +++ .../doc/snippets/textdocument-tables/xmlwriter.h | 64 ++ src/gui/doc/src/richtext.qdoc | 1214 ++++++++++++++++++++ 65 files changed, 4803 insertions(+) create mode 100644 src/gui/doc/images/plaintext-layout.png create mode 100644 src/gui/doc/images/richtext-document.png create mode 100644 src/gui/doc/snippets/code/doc_src_richtext.cpp create mode 100644 src/gui/doc/snippets/code/doc_src_richtext.qdoc create mode 100644 src/gui/doc/snippets/plaintextlayout/main.cpp create mode 100644 src/gui/doc/snippets/plaintextlayout/plaintextlayout.pro create mode 100644 src/gui/doc/snippets/plaintextlayout/window.cpp create mode 100644 src/gui/doc/snippets/plaintextlayout/window.h create mode 100644 src/gui/doc/snippets/scribe-overview/main.cpp create mode 100644 src/gui/doc/snippets/scribe-overview/scribe-overview.pro create mode 100644 src/gui/doc/snippets/textblock-formats/main.cpp create mode 100644 src/gui/doc/snippets/textblock-formats/textblock-formats.pro create mode 100644 src/gui/doc/snippets/textblock-fragments/main.cpp create mode 100644 src/gui/doc/snippets/textblock-fragments/mainwindow.cpp create mode 100644 src/gui/doc/snippets/textblock-fragments/mainwindow.h create mode 100644 src/gui/doc/snippets/textblock-fragments/textblock-fragments.pro create mode 100644 src/gui/doc/snippets/textblock-fragments/xmlwriter.h create mode 100644 src/gui/doc/snippets/textdocument-blocks/main.cpp create mode 100644 src/gui/doc/snippets/textdocument-blocks/mainwindow.cpp create mode 100644 src/gui/doc/snippets/textdocument-blocks/mainwindow.h create mode 100644 src/gui/doc/snippets/textdocument-blocks/textdocument-blocks.pro create mode 100644 src/gui/doc/snippets/textdocument-blocks/xmlwriter.cpp create mode 100644 src/gui/doc/snippets/textdocument-blocks/xmlwriter.h create mode 100644 src/gui/doc/snippets/textdocument-charformats/main.cpp create mode 100644 src/gui/doc/snippets/textdocument-charformats/textdocument-charformats.pro create mode 100644 src/gui/doc/snippets/textdocument-cursors/main.cpp create mode 100644 src/gui/doc/snippets/textdocument-cursors/textdocument-cursors.pro create mode 100644 src/gui/doc/snippets/textdocument-find/main.cpp create mode 100644 src/gui/doc/snippets/textdocument-find/textdocument-find.pro create mode 100644 src/gui/doc/snippets/textdocument-frames/main.cpp create mode 100644 src/gui/doc/snippets/textdocument-frames/mainwindow.cpp create mode 100644 src/gui/doc/snippets/textdocument-frames/mainwindow.h create mode 100644 src/gui/doc/snippets/textdocument-frames/textdocument-frames.pro create mode 100644 src/gui/doc/snippets/textdocument-frames/xmlwriter.cpp create mode 100644 src/gui/doc/snippets/textdocument-frames/xmlwriter.h create mode 100644 src/gui/doc/snippets/textdocument-imagedrop/main.cpp create mode 100644 src/gui/doc/snippets/textdocument-imagedrop/textdocument-imagedrop.pro create mode 100644 src/gui/doc/snippets/textdocument-imagedrop/textedit.h create mode 100644 src/gui/doc/snippets/textdocument-imageformat/images.qrc create mode 100644 src/gui/doc/snippets/textdocument-imageformat/images/advert.png create mode 100644 src/gui/doc/snippets/textdocument-imageformat/images/newimage.png create mode 100644 src/gui/doc/snippets/textdocument-imageformat/main.cpp create mode 100644 src/gui/doc/snippets/textdocument-imageformat/textdocument-imageformat.pro create mode 100644 src/gui/doc/snippets/textdocument-images/images.qrc create mode 100644 src/gui/doc/snippets/textdocument-images/images/advert.png create mode 100644 src/gui/doc/snippets/textdocument-images/main.cpp create mode 100644 src/gui/doc/snippets/textdocument-images/textdocument-images.pro create mode 100644 src/gui/doc/snippets/textdocument-listitems/main.cpp create mode 100644 src/gui/doc/snippets/textdocument-listitems/mainwindow.cpp create mode 100644 src/gui/doc/snippets/textdocument-listitems/mainwindow.h create mode 100644 src/gui/doc/snippets/textdocument-listitems/textdocument-listitems.pro create mode 100644 src/gui/doc/snippets/textdocument-printing/main.cpp create mode 100644 src/gui/doc/snippets/textdocument-printing/mainwindow.cpp create mode 100644 src/gui/doc/snippets/textdocument-printing/mainwindow.h create mode 100644 src/gui/doc/snippets/textdocument-printing/textdocument-printing.pro create mode 100644 src/gui/doc/snippets/textdocument-selections/main.cpp create mode 100644 src/gui/doc/snippets/textdocument-selections/mainwindow.cpp create mode 100644 src/gui/doc/snippets/textdocument-selections/mainwindow.h create mode 100644 src/gui/doc/snippets/textdocument-selections/textdocument-selections.pro create mode 100644 src/gui/doc/snippets/textdocument-tables/main.cpp create mode 100644 src/gui/doc/snippets/textdocument-tables/mainwindow.h create mode 100644 src/gui/doc/snippets/textdocument-tables/textdocument-tables.pro create mode 100644 src/gui/doc/snippets/textdocument-tables/xmlwriter.cpp create mode 100644 src/gui/doc/snippets/textdocument-tables/xmlwriter.h create mode 100644 src/gui/doc/src/richtext.qdoc diff --git a/src/gui/doc/images/plaintext-layout.png b/src/gui/doc/images/plaintext-layout.png new file mode 100644 index 0000000000000000000000000000000000000000..9172d7a044d5828fc755bf9e126d089b8ef57dde GIT binary patch literal 46384 zcmV*eKvBPmP)i}^2fcq|7B0_PES1(W(=rcU>BBPL`8DWu)va8a?VK3IU`|V$w|z5=78j2Ktu#{ z&X`c||DE~m7VW&SZCl`y6RWeC;afkk^lbpzs0Vu^w*QG{^x1e zXMFy}_jU1dyc{owl&^yqt})=m%Qr7?s{qojRRDOZ@Tj?J~vhzl5}&QGPm^gKVBgzq)dgfxAwoe z67`4PSaGO#m;cFVAzqG`V=Mdg2K@|$mY^sRUQz_w6X8LhnRgY;y*E@GdPj{>UuQBqD z%ul==FUMGha-bim2wH-oL|`r2`;^vxP7CjIw9HRXCiDrFit0k|6`|V4rP~f4p3-q{wYtM^t~7|dXz|WkqmP%5Mq9Ps*h;lWA73N?^?jIs=m#o- zmY}GnBCxhI{O_58GBgQgLZ48ns4n#07VYOktL`_X&yBI%+q~VJW^JZtP<|U-3B7j= z_g1MpuH4OSPB{I{QjL>G)NMAcV$G3Uy18QCrYTcXI?Ta@(4yVUHl6NHZZoY$-2t`g z4{q6hcI%GwTC|->fnQsv&Z}N`c!erMxC<(*RA)@(%uk^zGq$RA$5yXDu3EjZ)$5I| zR)1X8dSmXaH7e;>Ua%ierL2(`)K9Bz5b1%h0)yT zc9$#99=5N-_Fh!>XJ8yu1T8^P&{azaul?+nnV(;j+s%S9p--r^O5L%c_cm`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#`7>m{Li2Tm7Nd+VUzV%Z_!^@1p46lut8`$;#%pXTt7HnENe zJ)WM2Dp<>Cl#!ftzIi)Z$(-xF4%?Nf`x#%0kd>E-`}5sVYn=sGhdU8ECC+S4z*OTk<);#N+q?`PY-+a%p zr-4@i6z4?m?@m6G&*U@c6YijPzWwc<=J~0gdeUFL<3o4db;qr@ehWX@MwtAc{Ga?E z_8*VnoZD}|?ZAWI`crQ>^4)vy_h+tf5>4dqy8n~w$@S#AdmSD*@Zi7LXa6_-e?k1i UXymz)BLDyZ07*qoM6N<$g8${GF#rGn literal 0 HcmV?d00001 diff --git a/src/gui/doc/images/richtext-document.png b/src/gui/doc/images/richtext-document.png new file mode 100644 index 0000000000000000000000000000000000000000..4ae5d16b610a675f334e597959e5f92c5c63197e GIT binary patch literal 8126 zcmV;vA3@-WP)y|VSe+6~rX#P;*V`V8B{t+h*)4l?M69;_#NR8LBla+RJ`5L!~ZN48#K2N|{;1}kZ~>~)ByEY zt#?{q#deEqyH&P5OuNJOF1q)$y@xf0hnPOZ)Q&NI*djgT-iO?4eD2j@N{B?XO-o3U znwBKp6$NHzwyBr2k3=L}N-HTptfw_tPw64yawywELfCMHB_zK)J77B9rcGl9Yf1&w1p6pg)hw1)VeK%@c0~bayjK7NaxX#D zREYPIdnI^ez>qYJ^o3cZn?QGVV4DWegmOW>CFeDuA3HgPdyk^Vu1m^CA+bhN3PYq{nG&8}k`+`H zbm6ofqS4#lsSuQAPr#rT86I1?BS82x|ML_HalO}e8F`dmNWG52^L)5Y5a%?52LreA_nyXFA__G&#{B+-iuoa`F-w1?h7n>8Ww!` z74|fLulJ*a`t@wuC>6QA>-OdRfWP9igVxg7_XjIjp^UH zmJSY&eo9k&xo$nVRggdA`qv+bG{+{dbZs!U4AV{A*wLQ=}2WyLTkMz9;=H7sNO;b;U(llxkpPo&(EcKA3YzoNE zO0KeH<`-tN>uR=E#Clh@c7>iZi^pXck*0J=HhQA6xzk-uxNCsByLwWx+`T>@;_b#V zlx%l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3oVR~@2LDx9oD~@GybE=AgI!iI_vJweB>(_askl=LN2K9c$ ziIye!wQqtx28!~pV8l3a+W(c@Dh4W(`(o{qAKHBbIIlvl7h*27AA;Ow|4RLyI}p|c z%eX~~3B4=^%3Na17^wWwRJut^HKXwAbwaMEW>j8Zrf%zJo_wO#Pe7M#SGmi;`daeF zx&^@a1z{cLQ-X`-xp#k%G3zODpN|ALD(N0}nQAusja!7!=&E9%c5+)-3{*!5$Z3@B z-yggv;R4s8_7wYA@#@wqr!!2KpqNMV@o?OGxP>Gj^|8#U15qmG%jdYXHC(vX{aQVl z6GDv{1EmCjm$N{fI#w|TY9*y<6gM4Rb|i5pL7QP|O#>6~%9qhC&FJ3;`nWcudS2bm zI#8Ll|Mag9-mljw15T^(Zu8}HYq^8(`ShlV-1$(4QiO4{_3J>%xSn)pG_5Ahwro{J zm&r(5)>n{`yhr`#>#sbo0fE6N`l4e;585E7{k5a>CL~RzQp84Il=WG5w33eI>Q+VU zKe5h$zykJkfNU2tS5$>5sW_j5;!wxLKsuHoB9YjzMzJa>V;L$oLDq9`zTM2{aI+c3 zt)oz@-N}A@LGQ;pP$#z72lo<$oWC0jl-X`2hdZa~k#+V$(?p-CNjN@v4qrNZ$|}VB zPEE!!&$&X$_fu9Q&Ufk+9Pykd6$egPix?mOt2pF2pA^lSvJO!`0ckks`IE&?^u02Q zE?+J}`o#!I48IhQ!b=poeldcGVV4q6aOrX}u3d~If(nJ07$j3D5%~;CyBI}`8Cy|F za<~Vx@DZ8VhvabAF;I5W%RI1=K~-@t(MQDJ2ak@LiJmq9rVqLIA@@GyUgLA`{|u)8 Y4@b3#=KW(SRR91007*qoM6N<$g1r2tp8x;= literal 0 HcmV?d00001 diff --git a/src/gui/doc/snippets/code/doc_src_richtext.cpp b/src/gui/doc/snippets/code/doc_src_richtext.cpp new file mode 100644 index 0000000..37d4171 --- /dev/null +++ b/src/gui/doc/snippets/code/doc_src_richtext.cpp @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//! [0] +QTextDocument *newDocument = new QTextDocument; +//! [0] + + +//! [1] +QTextEdit *editor = new QTextEdit; +QTextDocument *editorDocument = editor->document(); +//! [1] + + +//! [2] +QTextEdit *editor = new QTextEdit(parent); +editor->setHtml(aStringContainingHTMLtext); +editor->show(); +//! [2] + + +//! [3] +QTextDocument *document = editor->document(); +//! [3] + + +//! [4] +QTextCursor cursor = editor->textCursor(); +//! [4] + + +//! [5] +editor->setTextCursor(cursor); +//! [5] + + +//! [6] +textEdit.show(); + +textCursor.beginEditBlock(); + +for (int i = 0; i < 1000; ++i) { + textCursor.insertBlock(); + textCursor.insertText(paragraphText.at(i)); +} + +textCursor.endEditBlock(); +//! [6] diff --git a/src/gui/doc/snippets/code/doc_src_richtext.qdoc b/src/gui/doc/snippets/code/doc_src_richtext.qdoc new file mode 100644 index 0000000..4cc947b --- /dev/null +++ b/src/gui/doc/snippets/code/doc_src_richtext.qdoc @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +//! [7] + +//! [7] diff --git a/src/gui/doc/snippets/plaintextlayout/main.cpp b/src/gui/doc/snippets/plaintextlayout/main.cpp new file mode 100644 index 0000000..3b10af4 --- /dev/null +++ b/src/gui/doc/snippets/plaintextlayout/main.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "window.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + Window *window = new Window; + window->resize(337, 343); + window->show(); + return app.exec(); +} diff --git a/src/gui/doc/snippets/plaintextlayout/plaintextlayout.pro b/src/gui/doc/snippets/plaintextlayout/plaintextlayout.pro new file mode 100644 index 0000000..6283406 --- /dev/null +++ b/src/gui/doc/snippets/plaintextlayout/plaintextlayout.pro @@ -0,0 +1,3 @@ +HEADERS = window.h +SOURCES = main.cpp \ + window.cpp diff --git a/src/gui/doc/snippets/plaintextlayout/window.cpp b/src/gui/doc/snippets/plaintextlayout/window.cpp new file mode 100644 index 0000000..901cfb4 --- /dev/null +++ b/src/gui/doc/snippets/plaintextlayout/window.cpp @@ -0,0 +1,108 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include + +#include "window.h" + +Window::Window(QWidget *parent) + : QWidget(parent) +{ + text = QString("Support for text rendering and layout in Qt 4 has been " + "redesigned around a system that allows textual content to " + "be represented in a more flexible way than was possible " + "with Qt 3. Qt 4 also provides a more convenient " + "programming interface for editing documents. These " + "improvements are made available through a reimplementation " + "of the existing text rendering engine, and the " + "introduction of several new classes. " + "See the relevant module overview for a detailed discussion " + "of this framework. The following sections provide a brief " + "overview of the main concepts behind Scribe."); + + setWindowTitle(tr("Plain Text Layout")); +} + +void Window::paintEvent(QPaintEvent *event) +{ +//! [0] + QTextLayout textLayout(text, font); + qreal margin = 10; + qreal radius = qMin(width()/2.0, height()/2.0) - margin; + QFontMetrics fm(font); + + qreal lineHeight = fm.height(); + qreal y = 0; + + textLayout.beginLayout(); + + while (1) { + // create a new line + QTextLine line = textLayout.createLine(); + if (!line.isValid()) + break; + + qreal x1 = qMax(0.0, pow(pow(radius,2)-pow(radius-y,2), 0.5)); + qreal x2 = qMax(0.0, pow(pow(radius,2)-pow(radius-(y+lineHeight),2), 0.5)); + qreal x = qMax(x1, x2) + margin; + qreal lineWidth = (width() - margin) - x; + + line.setLineWidth(lineWidth); + line.setPosition(QPointF(x, margin+y)); + y += line.height(); + } + + textLayout.endLayout(); + + QPainter painter; + painter.begin(this); + painter.setRenderHint(QPainter::Antialiasing); + painter.fillRect(rect(), Qt::white); + painter.setBrush(QBrush(Qt::black)); + painter.setPen(QPen(Qt::black)); + textLayout.draw(&painter, QPoint(0,0)); + + painter.setBrush(QBrush(QColor("#a6ce39"))); + painter.setPen(QPen(Qt::black)); + painter.drawEllipse(QRectF(-radius, margin, 2*radius, 2*radius)); + painter.end(); +//! [0] +} diff --git a/src/gui/doc/snippets/plaintextlayout/window.h b/src/gui/doc/snippets/plaintextlayout/window.h new file mode 100644 index 0000000..d6292de --- /dev/null +++ b/src/gui/doc/snippets/plaintextlayout/window.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef WINDOW_H +#define WINDOW_H + +#include + +class Window : public QWidget +{ + Q_OBJECT + +public: + Window(QWidget *parent = 0); + +protected: + void paintEvent(QPaintEvent *event); + +private: + QFont font; + QString text; +}; + +#endif diff --git a/src/gui/doc/snippets/scribe-overview/main.cpp b/src/gui/doc/snippets/scribe-overview/main.cpp new file mode 100644 index 0000000..96d1b7a --- /dev/null +++ b/src/gui/doc/snippets/scribe-overview/main.cpp @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +void mergeFormat(QTextEdit *edit) +{ +//! [0] + QTextDocument *document = edit->document(); + QTextCursor cursor(document); + + cursor.movePosition(QTextCursor::Start); + cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); + + QTextCharFormat format; + format.setFontWeight(QFont::Bold); + + cursor.mergeCharFormat(format); +//! [0] +} + +int main(int argc, char *argv[]) +{ + QWidget *parent = 0; + QString aStringContainingHTMLtext("

Scribe Overview

"); + + QApplication app(argc, argv); + +//! [1] + QTextEdit *editor = new QTextEdit(parent); + editor->setHtml(aStringContainingHTMLtext); + editor->show(); +//! [1] + + return app.exec(); +} diff --git a/src/gui/doc/snippets/scribe-overview/scribe-overview.pro b/src/gui/doc/snippets/scribe-overview/scribe-overview.pro new file mode 100644 index 0000000..16181f2 --- /dev/null +++ b/src/gui/doc/snippets/scribe-overview/scribe-overview.pro @@ -0,0 +1 @@ +SOURCES = main.cpp diff --git a/src/gui/doc/snippets/textblock-formats/main.cpp b/src/gui/doc/snippets/textblock-formats/main.cpp new file mode 100644 index 0000000..2f87341 --- /dev/null +++ b/src/gui/doc/snippets/textblock-formats/main.cpp @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +QString tr(const char *text) +{ + return QApplication::translate(text, text); +} + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + +//! [0] + QTextEdit *editor = new QTextEdit(); + QTextCursor cursor(editor->textCursor()); +//! [0] + cursor.movePosition(QTextCursor::Start); + + QTextBlockFormat blockFormat = cursor.blockFormat(); + blockFormat.setTopMargin(4); + blockFormat.setLeftMargin(4); + blockFormat.setRightMargin(4); + blockFormat.setBottomMargin(4); + + cursor.setBlockFormat(blockFormat); + cursor.insertText(tr("This contains plain text inside a " + "text block with margins to keep it separate " + "from other parts of the document.")); + + cursor.insertBlock(); + +//! [1] + QTextBlockFormat backgroundFormat = blockFormat; + backgroundFormat.setBackground(QColor("lightGray")); + + cursor.setBlockFormat(backgroundFormat); +//! [1] + cursor.insertText(tr("The background color of a text block can be " + "changed to highlight text.")); + + cursor.insertBlock(); + + QTextBlockFormat rightAlignedFormat = blockFormat; + rightAlignedFormat.setAlignment(Qt::AlignRight); + + cursor.setBlockFormat(rightAlignedFormat); + cursor.insertText(tr("The alignment of the text within a block is " + "controlled by the alignment properties of " + "the block itself. This text block is " + "right-aligned.")); + + cursor.insertBlock(); + + QTextBlockFormat paragraphFormat = blockFormat; + paragraphFormat.setAlignment(Qt::AlignJustify); + paragraphFormat.setTextIndent(32); + + cursor.setBlockFormat(paragraphFormat); + cursor.insertText(tr("Text can be formatted so that the first " + "line in a paragraph has its own margin. " + "This makes the text more readable.")); + + cursor.insertBlock(); + + QTextBlockFormat reverseFormat = blockFormat; + reverseFormat.setAlignment(Qt::AlignJustify); + reverseFormat.setTextIndent(32); + + cursor.setBlockFormat(reverseFormat); + cursor.insertText(tr("The direction of the text can be reversed. " + "This is useful for right-to-left " + "languages.")); + + editor->setWindowTitle(tr("Text Block Formats")); + editor->resize(480, 480); + editor->show(); + + return app.exec(); +} diff --git a/src/gui/doc/snippets/textblock-formats/textblock-formats.pro b/src/gui/doc/snippets/textblock-formats/textblock-formats.pro new file mode 100644 index 0000000..d664835 --- /dev/null +++ b/src/gui/doc/snippets/textblock-formats/textblock-formats.pro @@ -0,0 +1,2 @@ +QT += xml +SOURCES = main.cpp diff --git a/src/gui/doc/snippets/textblock-fragments/main.cpp b/src/gui/doc/snippets/textblock-fragments/main.cpp new file mode 100644 index 0000000..bc9eb83 --- /dev/null +++ b/src/gui/doc/snippets/textblock-fragments/main.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "mainwindow.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + MainWindow *window = new MainWindow; + window->resize(640, 480); + window->show(); + return app.exec(); +} diff --git a/src/gui/doc/snippets/textblock-fragments/mainwindow.cpp b/src/gui/doc/snippets/textblock-fragments/mainwindow.cpp new file mode 100644 index 0000000..0771359 --- /dev/null +++ b/src/gui/doc/snippets/textblock-fragments/mainwindow.cpp @@ -0,0 +1,148 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "mainwindow.h" +#include "xmlwriter.h" + +MainWindow::MainWindow() +{ + QMenu *fileMenu = new QMenu(tr("&File")); + + QAction *saveAction = fileMenu->addAction(tr("&Save...")); + saveAction->setShortcut(tr("Ctrl+S")); + + QAction *quitAction = fileMenu->addAction(tr("E&xit")); + quitAction->setShortcut(tr("Ctrl+Q")); + + QMenu *insertMenu = new QMenu(tr("&Insert")); + + QAction *calendarAction = insertMenu->addAction(tr("&Calendar")); + calendarAction->setShortcut(tr("Ctrl+I")); + + menuBar()->addMenu(fileMenu); + menuBar()->addMenu(insertMenu); + + editor = new QTextEdit(this); + + connect(saveAction, SIGNAL(triggered()), this, SLOT(saveFile())); + connect(quitAction, SIGNAL(triggered()), this, SLOT(close())); + connect(calendarAction, SIGNAL(triggered()), this, SLOT(insertCalendar())); + + setCentralWidget(editor); + setWindowTitle(tr("Text Document Writer")); +} + +void MainWindow::saveFile() +{ + QString fileName = QFileDialog::getSaveFileName(this, + tr("Save document as:"), "", tr("XML (*.xml)")); + + if (!fileName.isEmpty()) { + if (writeXml(fileName)) + setWindowTitle(fileName); + else + QMessageBox::warning(this, tr("Warning"), + tr("Failed to save the document."), QMessageBox::Cancel, + QMessageBox::NoButton); + } +} + +void MainWindow::insertCalendar() +{ + QTextCursor cursor(editor->textCursor()); + cursor.movePosition(QTextCursor::Start); + + QTextCharFormat format(cursor.charFormat()); + format.setFontFamily("Courier"); + + QTextCharFormat boldFormat = format; + boldFormat.setFontWeight(QFont::Bold); + + cursor.insertBlock(); + cursor.insertText(" ", boldFormat); + + QDate date = QDate::currentDate(); + int year = date.year(), month = date.month(); + + for (int weekDay = 1; weekDay <= 7; ++weekDay) { + cursor.insertText(QString("%1 ").arg(QDate::shortDayName(weekDay), 3), + boldFormat); + } + + cursor.insertBlock(); + cursor.insertText(" ", format); + + for (int column = 1; column < QDate(year, month, 1).dayOfWeek(); ++column) { + cursor.insertText(" ", format); + } + + for (int day = 1; day <= date.daysInMonth(); ++day) { + int weekDay = QDate(year, month, day).dayOfWeek(); + + if (QDate(year, month, day) == date) + cursor.insertText(QString("%1 ").arg(day, 3), boldFormat); + else + cursor.insertText(QString("%1 ").arg(day, 3), format); + + if (weekDay == 7) { + cursor.insertBlock(); + cursor.insertText(" ", format); + } + } +} + +bool MainWindow::writeXml(const QString &fileName) +{ + XmlWriter documentWriter(editor->document()); + + QDomDocument *domDocument = documentWriter.toXml(); + QFile file(fileName); + + if (file.open(QFile::WriteOnly)) { + QTextStream textStream(&file); + + textStream << domDocument->toByteArray(1); + return true; + } + else + return false; +} diff --git a/src/gui/doc/snippets/textblock-fragments/mainwindow.h b/src/gui/doc/snippets/textblock-fragments/mainwindow.h new file mode 100644 index 0000000..cfe504a --- /dev/null +++ b/src/gui/doc/snippets/textblock-fragments/mainwindow.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef WINDOW_H +#define WINDOW_H + +#include + +class QTextEdit; + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(); + +public slots: + void insertCalendar(); + void saveFile(); + +private: + bool writeXml(const QString &fileName); + + QTextEdit *editor; +}; + +#endif diff --git a/src/gui/doc/snippets/textblock-fragments/textblock-fragments.pro b/src/gui/doc/snippets/textblock-fragments/textblock-fragments.pro new file mode 100644 index 0000000..83ed78e --- /dev/null +++ b/src/gui/doc/snippets/textblock-fragments/textblock-fragments.pro @@ -0,0 +1,6 @@ +QT += xml +HEADERS = mainwindow.h \ + xmlwriter.h +SOURCES = main.cpp \ + mainwindow.cpp \ + xmlwriter.cpp diff --git a/src/gui/doc/snippets/textblock-fragments/xmlwriter.h b/src/gui/doc/snippets/textblock-fragments/xmlwriter.h new file mode 100644 index 0000000..23bda6b --- /dev/null +++ b/src/gui/doc/snippets/textblock-fragments/xmlwriter.h @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef XMLWRITER_H +#define XMLWRITER_H + +#include + +class QTextDocument; + +class XmlWriter +{ +public: + XmlWriter(QTextDocument *document) : textDocument(document) {} + QDomDocument *toXml(); + +private: + void readFragment(const QTextBlock ¤tBlock, QDomElement blockElement, + QDomDocument *document); + void processBlock(const QTextBlock ¤tBlock); + void processFragment(const QTextFragment ¤tFragment); + + QDomDocument *document; + QTextDocument *textDocument; +}; + +#endif diff --git a/src/gui/doc/snippets/textdocument-blocks/main.cpp b/src/gui/doc/snippets/textdocument-blocks/main.cpp new file mode 100644 index 0000000..bc9eb83 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-blocks/main.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "mainwindow.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + MainWindow *window = new MainWindow; + window->resize(640, 480); + window->show(); + return app.exec(); +} diff --git a/src/gui/doc/snippets/textdocument-blocks/mainwindow.cpp b/src/gui/doc/snippets/textdocument-blocks/mainwindow.cpp new file mode 100644 index 0000000..aca4406 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-blocks/mainwindow.cpp @@ -0,0 +1,156 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "mainwindow.h" +#include "xmlwriter.h" + +MainWindow::MainWindow() +{ + QMenu *fileMenu = new QMenu(tr("&File")); + + QAction *saveAction = fileMenu->addAction(tr("&Save...")); + saveAction->setShortcut(tr("Ctrl+S")); + + QAction *quitAction = fileMenu->addAction(tr("E&xit")); + quitAction->setShortcut(tr("Ctrl+Q")); + + QMenu *insertMenu = new QMenu(tr("&Insert")); + + QAction *calendarAction = insertMenu->addAction(tr("&Calendar")); + calendarAction->setShortcut(tr("Ctrl+I")); + + menuBar()->addMenu(fileMenu); + menuBar()->addMenu(insertMenu); + +//! [0] + editor = new QTextEdit(this); +//! [0] + + connect(saveAction, SIGNAL(triggered()), this, SLOT(saveFile())); + connect(quitAction, SIGNAL(triggered()), this, SLOT(close())); + connect(calendarAction, SIGNAL(triggered()), this, SLOT(insertCalendar())); + + setCentralWidget(editor); + setWindowTitle(tr("Text Document Writer")); +} + +void MainWindow::saveFile() +{ + QString fileName = QFileDialog::getSaveFileName(this, + tr("Save document as:"), "", tr("XML (*.xml)")); + + if (!fileName.isEmpty()) { + if (writeXml(fileName)) + setWindowTitle(fileName); + else + QMessageBox::warning(this, tr("Warning"), + tr("Failed to save the document."), QMessageBox::Cancel, + QMessageBox::NoButton); + } +} + +void MainWindow::insertCalendar() +{ +//! [1] + QTextCursor cursor(editor->textCursor()); + cursor.movePosition(QTextCursor::Start); + + QTextCharFormat format(cursor.charFormat()); + format.setFontFamily("Courier"); + + QTextCharFormat boldFormat = format; + boldFormat.setFontWeight(QFont::Bold); + + cursor.insertBlock(); + cursor.insertText(" ", boldFormat); + + QDate date = QDate::currentDate(); + int year = date.year(), month = date.month(); + + for (int weekDay = 1; weekDay <= 7; ++weekDay) { + cursor.insertText(QString("%1 ").arg(QDate::shortDayName(weekDay), 3), + boldFormat); + } + + cursor.insertBlock(); + cursor.insertText(" ", format); + + for (int column = 1; column < QDate(year, month, 1).dayOfWeek(); ++column) { + cursor.insertText(" ", format); + } + + for (int day = 1; day <= date.daysInMonth(); ++day) { +//! [1] //! [2] + int weekDay = QDate(year, month, day).dayOfWeek(); + + if (QDate(year, month, day) == date) + cursor.insertText(QString("%1 ").arg(day, 3), boldFormat); + else + cursor.insertText(QString("%1 ").arg(day, 3), format); + + if (weekDay == 7) { + cursor.insertBlock(); + cursor.insertText(" ", format); + } +//! [2] //! [3] + } +//! [3] +} + +bool MainWindow::writeXml(const QString &fileName) +{ + XmlWriter documentWriter(editor->document()); + + QDomDocument *domDocument = documentWriter.toXml(); + QFile file(fileName); + + if (file.open(QFile::WriteOnly)) { + QTextStream textStream(&file); + textStream.setCodec(QTextCodec::codecForName("UTF-8")); + + textStream << domDocument->toString(1).toUtf8(); + file.close(); + return true; + } + else + return false; +} diff --git a/src/gui/doc/snippets/textdocument-blocks/mainwindow.h b/src/gui/doc/snippets/textdocument-blocks/mainwindow.h new file mode 100644 index 0000000..cfe504a --- /dev/null +++ b/src/gui/doc/snippets/textdocument-blocks/mainwindow.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef WINDOW_H +#define WINDOW_H + +#include + +class QTextEdit; + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(); + +public slots: + void insertCalendar(); + void saveFile(); + +private: + bool writeXml(const QString &fileName); + + QTextEdit *editor; +}; + +#endif diff --git a/src/gui/doc/snippets/textdocument-blocks/textdocument-blocks.pro b/src/gui/doc/snippets/textdocument-blocks/textdocument-blocks.pro new file mode 100644 index 0000000..83ed78e --- /dev/null +++ b/src/gui/doc/snippets/textdocument-blocks/textdocument-blocks.pro @@ -0,0 +1,6 @@ +QT += xml +HEADERS = mainwindow.h \ + xmlwriter.h +SOURCES = main.cpp \ + mainwindow.cpp \ + xmlwriter.cpp diff --git a/src/gui/doc/snippets/textdocument-blocks/xmlwriter.cpp b/src/gui/doc/snippets/textdocument-blocks/xmlwriter.cpp new file mode 100644 index 0000000..2c691f8 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-blocks/xmlwriter.cpp @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "xmlwriter.h" + +QDomDocument *XmlWriter::toXml() +{ + QDomImplementation implementation; + QDomDocumentType docType = implementation.createDocumentType( + "scribe-document", "scribe", "qt.nokia.com/scribe"); + + document = new QDomDocument(docType); + + // ### This processing instruction is required to ensure that any kind + // of encoding is given when the document is written. + QDomProcessingInstruction process = document->createProcessingInstruction( + "xml", "version=\"1.0\" encoding=\"utf-8\""); + document->appendChild(process); + + QDomElement documentElement = document->createElement("document"); + document->appendChild(documentElement); + + QTextBlock firstBlock = textDocument->begin(); + createItems(documentElement, firstBlock); + + return document; +} + +void XmlWriter::createItems(QDomElement &parent, const QTextBlock &block) +{ + QTextBlock currentBlock = block; + + while (currentBlock.isValid()) { + QDomElement blockElement = document->createElement("block"); + blockElement.setAttribute("length", currentBlock.length()); + parent.appendChild(blockElement); + + if (!(currentBlock.text().isNull())) { + QDomText textNode = document->createTextNode(currentBlock.text()); + blockElement.appendChild(textNode); + } + + currentBlock = currentBlock.next(); + } +} diff --git a/src/gui/doc/snippets/textdocument-blocks/xmlwriter.h b/src/gui/doc/snippets/textdocument-blocks/xmlwriter.h new file mode 100644 index 0000000..e0afaf5 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-blocks/xmlwriter.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef XMLWRITER_H +#define XMLWRITER_H + +#include + +class QTextDocument; + +class XmlWriter +{ +public: + XmlWriter(QTextDocument *document) : textDocument(document) {} + QDomDocument *toXml(); + +private: + void createItems(QDomElement &parent, const QTextBlock &block); + + QDomDocument *document; + QTextDocument *textDocument; +}; + +#endif diff --git a/src/gui/doc/snippets/textdocument-charformats/main.cpp b/src/gui/doc/snippets/textdocument-charformats/main.cpp new file mode 100644 index 0000000..cedb090 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-charformats/main.cpp @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +QString tr(const char *text) +{ + return QApplication::translate(text, text); +} + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + QTextEdit *editor = new QTextEdit(); + + QTextCursor cursor(editor->textCursor()); + cursor.movePosition(QTextCursor::Start); + + QTextCharFormat plainFormat(cursor.charFormat()); + + QTextCharFormat headingFormat = plainFormat; + headingFormat.setFontWeight(QFont::Bold); + headingFormat.setFontPointSize(16); + + QTextCharFormat emphasisFormat = plainFormat; + emphasisFormat.setFontItalic(true); + + QTextCharFormat qtFormat = plainFormat; + qtFormat.setForeground(QColor("#990000")); + + QTextCharFormat underlineFormat = plainFormat; + underlineFormat.setFontUnderline(true); + +//! [0] + cursor.insertText(tr("Character formats"), + headingFormat); + + cursor.insertBlock(); + + cursor.insertText(tr("Text can be displayed in a variety of " + "different character formats. "), plainFormat); + cursor.insertText(tr("We can emphasize text by ")); + cursor.insertText(tr("making it italic"), emphasisFormat); +//! [0] + cursor.insertText(tr(", give it a "), plainFormat); + cursor.insertText(tr("different color "), qtFormat); + cursor.insertText(tr("to the default text color, "), plainFormat); + cursor.insertText(tr("underline it"), underlineFormat); + cursor.insertText(tr(", and use many other effects."), plainFormat); + + editor->setWindowTitle(tr("Text Document Character Formats")); + editor->resize(320, 480); + editor->show(); + return app.exec(); +} diff --git a/src/gui/doc/snippets/textdocument-charformats/textdocument-charformats.pro b/src/gui/doc/snippets/textdocument-charformats/textdocument-charformats.pro new file mode 100644 index 0000000..16181f2 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-charformats/textdocument-charformats.pro @@ -0,0 +1 @@ +SOURCES = main.cpp diff --git a/src/gui/doc/snippets/textdocument-cursors/main.cpp b/src/gui/doc/snippets/textdocument-cursors/main.cpp new file mode 100644 index 0000000..f6afae5 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-cursors/main.cpp @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +QString tr(const char *text) +{ + return QApplication::translate(text, text); +} + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + QTextEdit *editor = new QTextEdit; + +//! [0] + QTextDocument *document = editor->document(); + QTextCursor redCursor(document); +//! [0] //! [1] + QTextCursor blueCursor(document); +//! [1] + + QTextCharFormat redFormat(redCursor.charFormat()); + redFormat.setForeground(Qt::red); + QTextCharFormat blueFormat(blueCursor.charFormat()); + blueFormat.setForeground(Qt::blue); + + redCursor.setCharFormat(redFormat); + blueCursor.setCharFormat(blueFormat); + + for (int i = 0; i < 20; ++i) { + if (i % 2 == 0) + redCursor.insertText(tr("%1 ").arg(i), redFormat); + if (i % 5 == 0) + blueCursor.insertText(tr("%1 ").arg(i), blueFormat); + } + + editor->setWindowTitle(tr("Text Document Cursors")); + editor->resize(320, 480); + editor->show(); + return app.exec(); +} diff --git a/src/gui/doc/snippets/textdocument-cursors/textdocument-cursors.pro b/src/gui/doc/snippets/textdocument-cursors/textdocument-cursors.pro new file mode 100644 index 0000000..16181f2 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-cursors/textdocument-cursors.pro @@ -0,0 +1 @@ +SOURCES = main.cpp diff --git a/src/gui/doc/snippets/textdocument-find/main.cpp b/src/gui/doc/snippets/textdocument-find/main.cpp new file mode 100644 index 0000000..44c26a8 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-find/main.cpp @@ -0,0 +1,91 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +QString tr(const char *text) +{ + return QApplication::translate(text, text); +} + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + QTextEdit *editor = new QTextEdit(); + + QTextCursor cursor(editor->textCursor()); + cursor.movePosition(QTextCursor::Start); + + QTextCharFormat plainFormat(cursor.charFormat()); + QTextCharFormat colorFormat = plainFormat; + colorFormat.setForeground(Qt::red); + + cursor.insertText(tr("Text can be displayed in a variety of " + "different character " + "formats. "), plainFormat); + cursor.insertText(tr("We can emphasize text by making it ")); + cursor.insertText(tr("italic, give it a different color ")); + cursor.insertText(tr("to the default text color, underline it, ")); + cursor.insertText(tr("and use many other effects.")); + + QString searchString = tr("text"); + + QTextDocument *document = editor->document(); +//! [0] + QTextCursor newCursor(document); + + while (!newCursor.isNull() && !newCursor.atEnd()) { + newCursor = document->find(searchString, newCursor); + + if (!newCursor.isNull()) { + newCursor.movePosition(QTextCursor::WordRight, + QTextCursor::KeepAnchor); + + newCursor.mergeCharFormat(colorFormat); + } +//! [0] //! [1] + } +//! [1] + + editor->setWindowTitle(tr("Text Document Find")); + editor->resize(320, 480); + editor->show(); + return app.exec(); +} diff --git a/src/gui/doc/snippets/textdocument-find/textdocument-find.pro b/src/gui/doc/snippets/textdocument-find/textdocument-find.pro new file mode 100644 index 0000000..16181f2 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-find/textdocument-find.pro @@ -0,0 +1 @@ +SOURCES = main.cpp diff --git a/src/gui/doc/snippets/textdocument-frames/main.cpp b/src/gui/doc/snippets/textdocument-frames/main.cpp new file mode 100644 index 0000000..3c065cd --- /dev/null +++ b/src/gui/doc/snippets/textdocument-frames/main.cpp @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "mainwindow.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + MainWindow *window = new MainWindow; + window->resize(480, 480); + window->show(); + return app.exec(); +} + diff --git a/src/gui/doc/snippets/textdocument-frames/mainwindow.cpp b/src/gui/doc/snippets/textdocument-frames/mainwindow.cpp new file mode 100644 index 0000000..4fca7d0 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-frames/mainwindow.cpp @@ -0,0 +1,161 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "mainwindow.h" +#include "xmlwriter.h" + +MainWindow::MainWindow() +{ + QMenu *fileMenu = new QMenu(tr("&File")); + + QAction *saveAction = fileMenu->addAction(tr("&Save...")); + saveAction->setShortcut(tr("Ctrl+S")); + + QAction *quitAction = fileMenu->addAction(tr("E&xit")); + quitAction->setShortcut(tr("Ctrl+Q")); + + menuBar()->addMenu(fileMenu); + editor = new QTextEdit(); + + QTextCursor cursor(editor->textCursor()); + cursor.movePosition(QTextCursor::Start); + + QTextFrame *mainFrame = cursor.currentFrame(); + + QTextCharFormat plainCharFormat; + QTextCharFormat boldCharFormat; + boldCharFormat.setFontWeight(QFont::Bold); +/* main frame +//! [0] + QTextFrame *mainFrame = cursor.currentFrame(); + cursor.insertText(...); +//! [0] +*/ + cursor.insertText("Text documents are represented by the " + "QTextDocument class, rather than by QString objects. " + "Each QTextDocument object contains information about " + "the document's internal representation, its structure, " + "and keeps track of modifications to provide undo/redo " + "facilities. This approach allows features such as the " + "layout management to be delegated to specialized " + "classes, but also provides a focus for the framework.", + plainCharFormat); + +//! [1] + QTextFrameFormat frameFormat; + frameFormat.setMargin(32); + frameFormat.setPadding(8); + frameFormat.setBorder(4); +//! [1] + cursor.insertFrame(frameFormat); + +/* insert frame +//! [2] + cursor.insertFrame(frameFormat); + cursor.insertText(...); +//! [2] +*/ + cursor.insertText("Documents are either converted from external sources " + "or created from scratch using Qt. The creation process " + "can done by an editor widget, such as QTextEdit, or by " + "explicit calls to the Scribe API.", boldCharFormat); + + cursor = mainFrame->lastCursorPosition(); +/* last cursor +//! [3] + cursor = mainFrame->lastCursorPosition(); + cursor.insertText(...); +//! [3] +*/ + cursor.insertText("There are two complementary ways to visualize the " + "contents of a document: as a linear buffer that is " + "used by editors to modify the contents, and as an " + "object hierarchy containing structural information " + "that is useful to layout engines. In the hierarchical " + "model, the objects generally correspond to visual " + "elements such as frames, tables, and lists. At a lower " + "level, these elements describe properties such as the " + "style of text used and its alignment. The linear " + "representation of the document is used for editing and " + "manipulation of the document's contents.", + plainCharFormat); + + + connect(saveAction, SIGNAL(triggered()), this, SLOT(saveFile())); + connect(quitAction, SIGNAL(triggered()), this, SLOT(close())); + + setCentralWidget(editor); + setWindowTitle(tr("Text Document Frames")); +} + +void MainWindow::saveFile() +{ + QString fileName = QFileDialog::getSaveFileName(this, + tr("Save document as:"), "", tr("XML (*.xml)")); + + if (!fileName.isEmpty()) { + if (writeXml(fileName)) + setWindowTitle(fileName); + else + QMessageBox::warning(this, tr("Warning"), + tr("Failed to save the document."), QMessageBox::Cancel, + QMessageBox::NoButton); + } +} +bool MainWindow::writeXml(const QString &fileName) +{ + XmlWriter documentWriter(editor->document()); + + QDomDocument *domDocument = documentWriter.toXml(); + QFile file(fileName); + + if (file.open(QFile::WriteOnly)) { + QTextStream textStream(&file); + textStream.setCodec(QTextCodec::codecForName("UTF-8")); + + textStream << domDocument->toString(1).toUtf8(); + file.close(); + return true; + } + else + return false; +} diff --git a/src/gui/doc/snippets/textdocument-frames/mainwindow.h b/src/gui/doc/snippets/textdocument-frames/mainwindow.h new file mode 100644 index 0000000..4f25902 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-frames/mainwindow.h @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef WINDOW_H +#define WINDOW_H + +#include + +class QTextEdit; + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(); + +public slots: + void saveFile(); + +private: + bool writeXml(const QString &fileName); + + QTextEdit *editor; +}; + +#endif diff --git a/src/gui/doc/snippets/textdocument-frames/textdocument-frames.pro b/src/gui/doc/snippets/textdocument-frames/textdocument-frames.pro new file mode 100644 index 0000000..91ae50f --- /dev/null +++ b/src/gui/doc/snippets/textdocument-frames/textdocument-frames.pro @@ -0,0 +1,6 @@ +SOURCES = main.cpp \ + mainwindow.cpp \ + xmlwriter.cpp +HEADERS = mainwindow.h \ + xmlwriter.h +QT += xml diff --git a/src/gui/doc/snippets/textdocument-frames/xmlwriter.cpp b/src/gui/doc/snippets/textdocument-frames/xmlwriter.cpp new file mode 100644 index 0000000..d4d8d83 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-frames/xmlwriter.cpp @@ -0,0 +1,118 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "xmlwriter.h" + +QDomDocument *XmlWriter::toXml() +{ + QDomImplementation implementation; + QDomDocumentType docType = implementation.createDocumentType( + "scribe-document", "scribe", "qt.nokia.com/scribe"); + + document = new QDomDocument(docType); + + // ### This processing instruction is required to ensure that any kind + // of encoding is given when the document is written. + QDomProcessingInstruction process = document->createProcessingInstruction( + "xml", "version=\"1.0\" encoding=\"utf-8\""); + document->appendChild(process); + + QDomElement documentElement = document->createElement("document"); + document->appendChild(documentElement); + +//! [0] + QTextFrame *root = textDocument->rootFrame(); +//! [0] + + if (root) + processFrame(documentElement, root); + + return document; +} + +void XmlWriter::processBlock(QDomElement &parent, const QTextBlock &block) +{ + QDomElement blockElement = document->createElement("block"); + blockElement.setAttribute("position", block.position()); + blockElement.setAttribute("length", block.length()); + parent.appendChild(blockElement); + + QTextBlock::iterator it; + for (it = block.begin(); !(it.atEnd()); ++it) { + QTextFragment fragment = it.fragment(); + + if (fragment.isValid()) { + QDomElement fragmentElement = document->createElement("fragment"); + blockElement.appendChild(fragmentElement); + + fragmentElement.setAttribute("length", fragment.length()); + QDomText fragmentText = document->createTextNode(fragment.text()); + + fragmentElement.appendChild(fragmentText); + } + } +} + +void XmlWriter::processFrame(QDomElement &parent, QTextFrame *frame) +{ + QDomElement frameElement = document->createElement("frame"); + frameElement.setAttribute("begin", frame->firstPosition()); + frameElement.setAttribute("end", frame->lastPosition()); + parent.appendChild(frameElement); + +//! [1] + QDomElement frameElement = ... + + QTextFrame::iterator it; + for (it = frame->begin(); !(it.atEnd()); ++it) { + + QTextFrame *childFrame = it.currentFrame(); + QTextBlock childBlock = it.currentBlock(); + + if (childFrame) +//! [1] //! [2] + processFrame(frameElement, childFrame); + else if (childBlock.isValid()) + processBlock(frameElement, childBlock); + } +//! [2] +} diff --git a/src/gui/doc/snippets/textdocument-frames/xmlwriter.h b/src/gui/doc/snippets/textdocument-frames/xmlwriter.h new file mode 100644 index 0000000..5953d93 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-frames/xmlwriter.h @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef XMLWRITER_H +#define XMLWRITER_H + +#include + +class QTextDocument; + +class XmlWriter +{ +public: + XmlWriter(QTextDocument *document) : textDocument(document) {} + QDomDocument *toXml(); + +private: + void processBlock(QDomElement &parent, const QTextBlock &block); + void processFrame(QDomElement &parent, QTextFrame *frame); + + QDomDocument *document; +//! [0] + QTextDocument *textDocument; +//! [0] +}; + +#endif diff --git a/src/gui/doc/snippets/textdocument-imagedrop/main.cpp b/src/gui/doc/snippets/textdocument-imagedrop/main.cpp new file mode 100644 index 0000000..771d9cf --- /dev/null +++ b/src/gui/doc/snippets/textdocument-imagedrop/main.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "textedit.h" + +int main(int argc, char * argv[]) +{ + QApplication app(argc, argv); + + TextEdit *textEdit = new TextEdit; + textEdit->show(); + + return app.exec(); +} \ No newline at end of file diff --git a/src/gui/doc/snippets/textdocument-imagedrop/textdocument-imagedrop.pro b/src/gui/doc/snippets/textdocument-imagedrop/textdocument-imagedrop.pro new file mode 100644 index 0000000..96d3038 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-imagedrop/textdocument-imagedrop.pro @@ -0,0 +1,2 @@ +SOURCES = textedit.cpp main.cpp +HEADERS = textedit.h \ No newline at end of file diff --git a/src/gui/doc/snippets/textdocument-imagedrop/textedit.h b/src/gui/doc/snippets/textdocument-imagedrop/textedit.h new file mode 100644 index 0000000..cfa7033 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-imagedrop/textedit.h @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef TEXTEDIT_H +#define TEXTEDIT_H + +#include + +class TextEdit : public QTextEdit +{ + Q_OBJECT + +public: + TextEdit(QWidget *parent=0); + bool canInsertFromMimeData( const QMimeData *source ) const; + void insertFromMimeData( const QMimeData *source ); +}; + +#endif diff --git a/src/gui/doc/snippets/textdocument-imageformat/images.qrc b/src/gui/doc/snippets/textdocument-imageformat/images.qrc new file mode 100644 index 0000000..6473daf --- /dev/null +++ b/src/gui/doc/snippets/textdocument-imageformat/images.qrc @@ -0,0 +1,6 @@ + + + images/advert.png + images/newimage.png + + diff --git a/src/gui/doc/snippets/textdocument-imageformat/images/advert.png b/src/gui/doc/snippets/textdocument-imageformat/images/advert.png new file mode 100644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z;Cn@?Wf-G0<*^CeL}LwbWUFJY^st_!9LRh|>h0K+q-h8(ca8`O-JMxZg{f7r3p_>K zFXv#TZOGACn>J0iHIB<8s=K3?10RH~T5Vk45I2#*Hb^-hvtdzZQ$^jdI`qi1#&x9ZONllW$TI53hA9)=)#EyZZ%K!iX07*qoM6N<$g2eoikpKVy literal 0 HcmV?d00001 diff --git a/src/gui/doc/snippets/textdocument-imageformat/main.cpp b/src/gui/doc/snippets/textdocument-imageformat/main.cpp new file mode 100644 index 0000000..923549f --- /dev/null +++ b/src/gui/doc/snippets/textdocument-imageformat/main.cpp @@ -0,0 +1,98 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +QString tr(const char *text) +{ + return QApplication::translate(text, text); +} + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + QTextEdit *editor = new QTextEdit; + + QTextDocument *document = new QTextDocument(editor); + QTextCursor cursor(document); + + QTextImageFormat imageFormat; + imageFormat.setName(":/images/advert.png"); + cursor.insertImage(imageFormat); + + QTextBlock block = cursor.block(); + QTextFragment fragment; + QTextBlock::iterator it; + + for (it = block.begin(); !(it.atEnd()); ++it) { + fragment = it.fragment(); + + if (fragment.contains(cursor.position())) + break; + } + +//! [0] + if (fragment.isValid()) { + QTextImageFormat newImageFormat = fragment.charFormat().toImageFormat(); + + if (newImageFormat.isValid()) { + newImageFormat.setName(":/images/newimage.png"); + QTextCursor helper = cursor; + + helper.setPosition(fragment.position()); + helper.setPosition(fragment.position() + fragment.length(), + QTextCursor::KeepAnchor); + helper.setCharFormat(newImageFormat); +//! [0] //! [1] + } +//! [1] //! [2] + } +//! [2] + + cursor.insertBlock(); + cursor.insertText("Code less. Create more."); + + editor->setDocument(document); + editor->setWindowTitle(tr("Text Document Image Format")); + editor->resize(320, 480); + editor->show(); + + return app.exec(); +} diff --git a/src/gui/doc/snippets/textdocument-imageformat/textdocument-imageformat.pro b/src/gui/doc/snippets/textdocument-imageformat/textdocument-imageformat.pro new file mode 100644 index 0000000..1c64370 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-imageformat/textdocument-imageformat.pro @@ -0,0 +1,2 @@ +SOURCES = main.cpp +RESOURCES += images.qrc diff --git a/src/gui/doc/snippets/textdocument-images/images.qrc b/src/gui/doc/snippets/textdocument-images/images.qrc new file mode 100644 index 0000000..09e305e --- /dev/null +++ b/src/gui/doc/snippets/textdocument-images/images.qrc @@ -0,0 +1,5 @@ + + + images/advert.png + + diff --git a/src/gui/doc/snippets/textdocument-images/images/advert.png b/src/gui/doc/snippets/textdocument-images/images/advert.png new file mode 100644 index 0000000000000000000000000000000000000000..40e10d5225dc1bdb09932ea11ba2eca3d0dd72a8 GIT binary patch literal 16291 zcmV;UKU~0xP)Olj~dCs5v=Vn(|MMg$uRlM;Gz~h+3Vti;YA^W^p7)JGo*thX1^~vuxnVHt4xe8tpXSvc@*785wFQCc z(9k-hSP%x)zW$}!WZ0P-8W_VyS(nxscC~qY2LUFCYOU~acCI^6_c{ZE=k9;tp9jzW z2LL3IHH#IFPdt#fN~|#8A#=EYvrK#uG>8lr!un9(XnVHK3PvCzOpIz}uu+?JECVB= z)mn`R_a+!fYOUi=Zgr`zuhyx#R-rYyt2B0YYjS6K&4qrv;M%z;sxQqxQz;E1W8BJ* z#z}+#&@jVKLjZO5inV51a{!cpnjnnt8*_TVCpi zDxi6mz(jxqVvdlIGKvzeTMH z+%+s$iTw^^P7?c+xCM7jyB+$`Vi+gPETJxH0A>(s2oOLLVUcwbVkQl&B!eji3TjhJ z%Vbs}A^{g?S61*lQpz7_@AoSSbt`$U)i)!_Z)sIHPJ}$w!sQO zQK%UJwgN;W>J}=DIS3G-5Qfw?3XWCaajaEHkbsJ7=?T8ji55zIYa~w+ok}hmwLPmY zycU6=vouA_eA{nU`_>~uz2+g&fK%uF!*gIGuyi@?F9fx=m{wS^?uFRT=?TolYF(LySlonW34 z;-|hqag;{X1WkV~l^h$m883R=3*(k)fR;ZeK@2b!s@?F8(H!7W+i%Zny@_n0;!3Xebf3`UlU) zMqWV(fBwuxy;%zZ;wl)-Uolp>3@d?PNhn5TQ&I?E9>NGot^vr9RzN`k5!MP~2q6+$ z6QwfSRT>Zt5Cjqk4WNc5&>BFl0W>v{Jkm%AY-@y};y`PpCB#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;1bdz&nIbA7)iPA95MiioMj6c(%Qg%T^5H1HM zNf%Iv5P=YNV@ipZw5wGarCMtVR4)*G@@Ji-?26XxfuNKUYvij$0?j0Fp=lCK2x5S! zl-HF=Rj3h6VWxj6#+ivhNB}l_R`%Dw%5{>;5CLG+0G^!fG@16(pq(3f0U6pFNue@> zQp_|pM3SdLeL*{U#}*Wu7%`=_kfGMlU=^e@`DD12pdJ$>fRKWtLbWeR+ERJQD#U&p z5Xqd1VY?DTFMvrm_^7k45-DZ(zM_cI7-7|2%BrAJKzF4&Vg?gJz^-vA0ZdF2AURM- z149F(Gu#D)3PA<5mJ$MOQbH8qT402s29#vzXK-L_8`RQRsx(Ow0l88tMp-*3d&yNO zvjR{+Gk~c^#E3PJz{f+@# + +QString tr(const char *text) +{ + return QApplication::translate(text, text); +} + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + QTextEdit *editor = new QTextEdit; + +//! [0] + QTextDocument *document = new QTextDocument(editor); + QTextCursor cursor(document); +//! [0] + +//! [1] + QTextImageFormat imageFormat; + imageFormat.setName(":/images/advert.png"); + cursor.insertImage(imageFormat); +//! [1] + + cursor.insertBlock(); + cursor.insertText("Code less. Create more."); + + editor->setDocument(document); + editor->setWindowTitle(tr("Text Document Images")); + editor->resize(320, 480); + editor->show(); + return app.exec(); +} diff --git a/src/gui/doc/snippets/textdocument-images/textdocument-images.pro b/src/gui/doc/snippets/textdocument-images/textdocument-images.pro new file mode 100644 index 0000000..1c64370 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-images/textdocument-images.pro @@ -0,0 +1,2 @@ +SOURCES = main.cpp +RESOURCES += images.qrc diff --git a/src/gui/doc/snippets/textdocument-listitems/main.cpp b/src/gui/doc/snippets/textdocument-listitems/main.cpp new file mode 100644 index 0000000..bc9eb83 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-listitems/main.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "mainwindow.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + MainWindow *window = new MainWindow; + window->resize(640, 480); + window->show(); + return app.exec(); +} diff --git a/src/gui/doc/snippets/textdocument-listitems/mainwindow.cpp b/src/gui/doc/snippets/textdocument-listitems/mainwindow.cpp new file mode 100644 index 0000000..1089a04 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-listitems/mainwindow.cpp @@ -0,0 +1,197 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "mainwindow.h" + +MainWindow::MainWindow() +{ + QMenu *fileMenu = new QMenu(tr("&File")); + + fileMenu->addAction(tr("E&xit"), this, SLOT(close()), + QKeySequence(tr("Ctrl+Q", "File|Exit"))); + + QMenu *actionsMenu = new QMenu(tr("&Actions")); + actionsMenu->addAction(tr("&Highlight List Items"), + this, SLOT(highlightListItems())); + actionsMenu->addAction(tr("&Show Current List"), this, SLOT(showList())); + + QMenu *insertMenu = new QMenu(tr("&Insert")); + + insertMenu->addAction(tr("&List"), this, SLOT(insertList()), + QKeySequence(tr("Ctrl+L", "Insert|List"))); + + menuBar()->addMenu(fileMenu); + menuBar()->addMenu(insertMenu); + menuBar()->addMenu(actionsMenu); + + editor = new QTextEdit(this); + document = new QTextDocument(this); + editor->setDocument(document); + + setCentralWidget(editor); + setWindowTitle(tr("Text Document List Items")); +} + +void MainWindow::highlightListItems() +{ + QTextCursor cursor = editor->textCursor(); + QTextList *list = cursor.currentList(); + + if (!list) + return; + + cursor.beginEditBlock(); +//! [0] + for (int index = 0; index < list->count(); ++index) { + QTextBlock listItem = list->item(index); +//! [0] + QTextBlockFormat newBlockFormat = listItem.blockFormat(); + newBlockFormat.setBackground(Qt::lightGray); + QTextCursor itemCursor = cursor; + itemCursor.setPosition(listItem.position()); + //itemCursor.movePosition(QTextCursor::StartOfBlock); + itemCursor.movePosition(QTextCursor::EndOfBlock, + QTextCursor::KeepAnchor); + itemCursor.setBlockFormat(newBlockFormat); + /* +//! [1] + processListItem(listItem); +//! [1] + */ +//! [2] + } +//! [2] + cursor.endEditBlock(); +} + +void MainWindow::showList() +{ + QTextCursor cursor = editor->textCursor(); + QTextFrame *frame = cursor.currentFrame(); + + if (!frame) + return; + + QTreeWidget *treeWidget = new QTreeWidget; + treeWidget->setColumnCount(1); + QStringList headerLabels; + headerLabels << tr("Lists"); + treeWidget->setHeaderLabels(headerLabels); + + QTreeWidgetItem *parentItem = 0; + QTreeWidgetItem *item; + QTreeWidgetItem *lastItem = 0; + parentItems.clear(); + previousItems.clear(); + +//! [3] + QTextFrame::iterator it; + for (it = frame->begin(); !(it.atEnd()); ++it) { + + QTextBlock block = it.currentBlock(); + + if (block.isValid()) { + + QTextList *list = block.textList(); + + if (list) { + int index = list->itemNumber(block); +//! [3] + if (index == 0) { + parentItems.append(parentItem); + previousItems.append(lastItem); + listStructures.append(list); + parentItem = lastItem; + lastItem = 0; + + if (parentItem != 0) + item = new QTreeWidgetItem(parentItem, lastItem); + else + item = new QTreeWidgetItem(treeWidget, lastItem); + + } else { + + while (parentItem != 0 && listStructures.last() != list) { + listStructures.pop_back(); + parentItem = parentItems.takeLast(); + lastItem = previousItems.takeLast(); + } + if (parentItem != 0) + item = new QTreeWidgetItem(parentItem, lastItem); + else + item = new QTreeWidgetItem(treeWidget, lastItem); + } + item->setText(0, block.text()); + lastItem = item; + /* +//! [4] + processListItem(list, index); +//! [4] + */ +//! [5] + } +//! [5] //! [6] + } +//! [6] //! [7] + } +//! [7] + + treeWidget->setWindowTitle(tr("List Contents")); + treeWidget->show(); +} + +void MainWindow::insertList() +{ + QTextCursor cursor = editor->textCursor(); + cursor.beginEditBlock(); + + QTextList *list = cursor.currentList(); + QTextListFormat listFormat; + if (list) + listFormat = list->format(); + + listFormat.setStyle(QTextListFormat::ListDisc); + listFormat.setIndent(listFormat.indent() + 1); + cursor.insertList(listFormat); + + cursor.endEditBlock(); +} diff --git a/src/gui/doc/snippets/textdocument-listitems/mainwindow.h b/src/gui/doc/snippets/textdocument-listitems/mainwindow.h new file mode 100644 index 0000000..b71cfea --- /dev/null +++ b/src/gui/doc/snippets/textdocument-listitems/mainwindow.h @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef WINDOW_H +#define WINDOW_H + +#include +#include +#include + +class QAction; +class QTextDocument; +class QTextEdit; +class QTextList; +class QTreeWidgetItem; + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(); + +public slots: + void insertList(); + void highlightListItems(); + void showList(); + +private: + QString currentFile; + QTextEdit *editor; + QTextDocument *document; + QList listStructures; + QList previousItems; + QList parentItems; +}; + +#endif diff --git a/src/gui/doc/snippets/textdocument-listitems/textdocument-listitems.pro b/src/gui/doc/snippets/textdocument-listitems/textdocument-listitems.pro new file mode 100644 index 0000000..5da8d6e --- /dev/null +++ b/src/gui/doc/snippets/textdocument-listitems/textdocument-listitems.pro @@ -0,0 +1,3 @@ +HEADERS = mainwindow.h +SOURCES = main.cpp \ + mainwindow.cpp diff --git a/src/gui/doc/snippets/textdocument-printing/main.cpp b/src/gui/doc/snippets/textdocument-printing/main.cpp new file mode 100644 index 0000000..bc9eb83 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-printing/main.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "mainwindow.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + MainWindow *window = new MainWindow; + window->resize(640, 480); + window->show(); + return app.exec(); +} diff --git a/src/gui/doc/snippets/textdocument-printing/mainwindow.cpp b/src/gui/doc/snippets/textdocument-printing/mainwindow.cpp new file mode 100644 index 0000000..6abe90a --- /dev/null +++ b/src/gui/doc/snippets/textdocument-printing/mainwindow.cpp @@ -0,0 +1,124 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "mainwindow.h" + +MainWindow::MainWindow() +{ + QMenu *fileMenu = new QMenu(tr("&File")); + + fileMenu->addAction(tr("&Open..."), this, SLOT(openFile()), + QKeySequence(tr("Ctrl+O", "File|Open"))); + + printAction = fileMenu->addAction(tr("&Print..."), this, SLOT(printFile())); + printAction->setEnabled(false); + + pdfPrintAction = fileMenu->addAction(tr("Print as P&DF..."), this, SLOT(printPdf())); + pdfPrintAction->setEnabled(false); + + fileMenu->addAction(tr("E&xit"), this, SLOT(close()), + QKeySequence(tr("Ctrl+Q", "File|Exit"))); + + menuBar()->addMenu(fileMenu); + + editor = new QTextEdit(this); + document = new QTextDocument(this); + editor->setDocument(document); + + connect(editor, SIGNAL(selectionChanged()), this, SLOT(updateMenus())); + + setCentralWidget(editor); + setWindowTitle(tr("Text Document Writer")); +} + +void MainWindow::openFile() +{ + QString fileName = QFileDialog::getOpenFileName(this, + tr("Open file"), currentFile, "HTML files (*.html);;Text files (*.txt)"); + + if (!fileName.isEmpty()) { + QFileInfo info(fileName); + if (info.completeSuffix() == "html") { + QFile file(fileName); + + if (file.open(QIODevice::ReadOnly)) { + editor->setHtml(file.readAll()); + file.close(); + currentFile = fileName; + } + } else if (info.completeSuffix() == "txt") { + QFile file(fileName); + + if (file.open(QIODevice::ReadOnly)) { + editor->setPlainText(file.readAll()); + file.close(); + currentFile = fileName; + } + } + printAction->setEnabled(true); + pdfPrintAction->setEnabled(true); + } +} + +void MainWindow::printFile() +{ +//! [0] + QTextDocument *document = editor->document(); + QPrinter printer; + + QPrintDialog *dlg = new QPrintDialog(&printer, this); + if (dlg->exec() != QDialog::Accepted) + return; + + document->print(&printer); +//! [0] +} + +void MainWindow::printPdf() +{ + QPrinter printer(QPrinter::HighResolution); + printer.setOutputFormat(QPrinter::PdfFormat); + + QPrintDialog *printDialog = new QPrintDialog(&printer, this); + if (printDialog->exec() == QDialog::Accepted) + editor->document()->print(&printer); +} diff --git a/src/gui/doc/snippets/textdocument-printing/mainwindow.h b/src/gui/doc/snippets/textdocument-printing/mainwindow.h new file mode 100644 index 0000000..cce30a9 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-printing/mainwindow.h @@ -0,0 +1,72 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include +#include + +class QAction; +class QTextDocument; +class QTextEdit; + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(); + +public slots: + void openFile(); + void printFile(); + void printPdf(); + +private: + QAction *printAction; + QAction *pdfPrintAction; + QString currentFile; + QTextEdit *editor; + QTextDocument *document; +}; + +#endif diff --git a/src/gui/doc/snippets/textdocument-printing/textdocument-printing.pro b/src/gui/doc/snippets/textdocument-printing/textdocument-printing.pro new file mode 100644 index 0000000..5da8d6e --- /dev/null +++ b/src/gui/doc/snippets/textdocument-printing/textdocument-printing.pro @@ -0,0 +1,3 @@ +HEADERS = mainwindow.h +SOURCES = main.cpp \ + mainwindow.cpp diff --git a/src/gui/doc/snippets/textdocument-selections/main.cpp b/src/gui/doc/snippets/textdocument-selections/main.cpp new file mode 100644 index 0000000..bc9eb83 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-selections/main.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "mainwindow.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + MainWindow *window = new MainWindow; + window->resize(640, 480); + window->show(); + return app.exec(); +} diff --git a/src/gui/doc/snippets/textdocument-selections/mainwindow.cpp b/src/gui/doc/snippets/textdocument-selections/mainwindow.cpp new file mode 100644 index 0000000..a776a92 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-selections/mainwindow.cpp @@ -0,0 +1,203 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "mainwindow.h" + +MainWindow::MainWindow() +{ + QMenu *fileMenu = new QMenu(tr("&File")); + + fileMenu->addAction(tr("&Open..."), this, SLOT(openFile()), + QKeySequence(tr("Ctrl+O", "File|Open"))); + + QAction *quitAction = fileMenu->addAction(tr("E&xit"), this, SLOT(close())); + quitAction->setShortcut(tr("Ctrl+Q")); + + QMenu *editMenu = new QMenu(tr("&Edit")); + + cutAction = editMenu->addAction(tr("Cu&t"), this, SLOT(cutSelection())); + cutAction->setShortcut(tr("Ctrl+X")); + cutAction->setEnabled(false); + + copyAction = editMenu->addAction(tr("&Copy"), this, SLOT(copySelection())); + copyAction->setShortcut(tr("Ctrl+C")); + copyAction->setEnabled(false); + + pasteAction = editMenu->addAction(tr("&Paste"), this, SLOT(pasteSelection())); + pasteAction->setShortcut(tr("Ctrl+V")); + pasteAction->setEnabled(false); + + QMenu *selectMenu = new QMenu(tr("&Select")); + selectMenu->addAction(tr("&Word"), this, SLOT(selectWord())); + selectMenu->addAction(tr("&Line"), this, SLOT(selectLine())); + selectMenu->addAction(tr("&Block"), this, SLOT(selectBlock())); + selectMenu->addAction(tr("&Frame"), this, SLOT(selectFrame())); + + menuBar()->addMenu(fileMenu); + menuBar()->addMenu(editMenu); + menuBar()->addMenu(selectMenu); + + editor = new QTextEdit(this); + document = new QTextDocument(this); + editor->setDocument(document); + + connect(editor, SIGNAL(selectionChanged()), this, SLOT(updateMenus())); + + setCentralWidget(editor); + setWindowTitle(tr("Text Document Writer")); +} + +void MainWindow::openFile() +{ + QString fileName = QFileDialog::getOpenFileName(this, + tr("Open file"), currentFile, "HTML files (*.html);;Text files (*.txt)"); + + if (!fileName.isEmpty()) { + QFileInfo info(fileName); + if (info.completeSuffix() == "html") { + QFile file(fileName); + + if (file.open(QFile::ReadOnly)) { + editor->setHtml(QString(file.readAll())); + file.close(); + currentFile = fileName; + } + } else if (info.completeSuffix() == "txt") { + QFile file(fileName); + + if (file.open(QFile::ReadOnly)) { + editor->setPlainText(file.readAll()); + file.close(); + currentFile = fileName; + } + } + } +} + +void MainWindow::cutSelection() +{ + QTextCursor cursor = editor->textCursor(); + if (cursor.hasSelection()) { + selection = cursor.selection(); + cursor.removeSelectedText(); + } +} + +void MainWindow::copySelection() +{ + QTextCursor cursor = editor->textCursor(); + if (cursor.hasSelection()) { + selection = cursor.selection(); + cursor.clearSelection(); + } +} + +void MainWindow::pasteSelection() +{ + QTextCursor cursor = editor->textCursor(); + cursor.insertFragment(selection); +} + +void MainWindow::selectWord() +{ + QTextCursor cursor = editor->textCursor(); + QTextBlock block = cursor.block(); + +//! [0] + cursor.beginEditBlock(); +//! [1] + cursor.movePosition(QTextCursor::StartOfWord); + cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor); +//! [1] + cursor.endEditBlock(); +//! [0] + + editor->setTextCursor(cursor); +} + +void MainWindow::selectLine() +{ + QTextCursor cursor = editor->textCursor(); + QTextBlock block = cursor.block(); + + cursor.beginEditBlock(); + cursor.movePosition(QTextCursor::StartOfLine); + cursor.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); + cursor.endEditBlock(); + + editor->setTextCursor(cursor); +} + +void MainWindow::selectBlock() +{ + QTextCursor cursor = editor->textCursor(); + QTextBlock block = cursor.block(); + + cursor.beginEditBlock(); + cursor.movePosition(QTextCursor::StartOfBlock); + cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); + cursor.endEditBlock(); + + editor->setTextCursor(cursor); +} + +void MainWindow::selectFrame() +{ + QTextCursor cursor = editor->textCursor(); + QTextFrame *frame = cursor.currentFrame(); + + cursor.beginEditBlock(); + cursor.setPosition(frame->firstPosition()); + cursor.setPosition(frame->lastPosition(), QTextCursor::KeepAnchor); + cursor.endEditBlock(); + + editor->setTextCursor(cursor); +} + +void MainWindow::updateMenus() +{ + QTextCursor cursor = editor->textCursor(); + cutAction->setEnabled(cursor.hasSelection()); + copyAction->setEnabled(cursor.hasSelection()); + + pasteAction->setEnabled(!selection.isEmpty()); +} diff --git a/src/gui/doc/snippets/textdocument-selections/mainwindow.h b/src/gui/doc/snippets/textdocument-selections/mainwindow.h new file mode 100644 index 0000000..9e512f9 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-selections/mainwindow.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef WINDOW_H +#define WINDOW_H + +#include +#include + +class QAction; +class QTextDocument; +class QTextEdit; + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(); + +public slots: + void cutSelection(); + void copySelection(); + void openFile(); + void pasteSelection(); + void selectWord(); + void selectLine(); + void selectBlock(); + void selectFrame(); + void updateMenus(); + +private: + QAction *cutAction; + QAction *copyAction; + QAction *pasteAction; + QString currentFile; + QTextEdit *editor; + QTextDocument *document; + QTextDocumentFragment selection; +}; + +#endif diff --git a/src/gui/doc/snippets/textdocument-selections/textdocument-selections.pro b/src/gui/doc/snippets/textdocument-selections/textdocument-selections.pro new file mode 100644 index 0000000..253c452 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-selections/textdocument-selections.pro @@ -0,0 +1,4 @@ +QT += xml +HEADERS = mainwindow.h +SOURCES = main.cpp \ + mainwindow.cpp diff --git a/src/gui/doc/snippets/textdocument-tables/main.cpp b/src/gui/doc/snippets/textdocument-tables/main.cpp new file mode 100644 index 0000000..e3ba2ba --- /dev/null +++ b/src/gui/doc/snippets/textdocument-tables/main.cpp @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "mainwindow.h" + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + MainWindow *window = new MainWindow; + window->resize(480, 480); + window->show(); + return app.exec(); +} diff --git a/src/gui/doc/snippets/textdocument-tables/mainwindow.h b/src/gui/doc/snippets/textdocument-tables/mainwindow.h new file mode 100644 index 0000000..6a93293 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-tables/mainwindow.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef WINDOW_H +#define WINDOW_H + +#include + +class QTextEdit; + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(); + +public slots: + void saveFile(); + void showTable(); + +private: + bool writeXml(const QString &fileName); + + QTextEdit *editor; +}; + +#endif diff --git a/src/gui/doc/snippets/textdocument-tables/textdocument-tables.pro b/src/gui/doc/snippets/textdocument-tables/textdocument-tables.pro new file mode 100644 index 0000000..91ae50f --- /dev/null +++ b/src/gui/doc/snippets/textdocument-tables/textdocument-tables.pro @@ -0,0 +1,6 @@ +SOURCES = main.cpp \ + mainwindow.cpp \ + xmlwriter.cpp +HEADERS = mainwindow.h \ + xmlwriter.h +QT += xml diff --git a/src/gui/doc/snippets/textdocument-tables/xmlwriter.cpp b/src/gui/doc/snippets/textdocument-tables/xmlwriter.cpp new file mode 100644 index 0000000..73d0f17 --- /dev/null +++ b/src/gui/doc/snippets/textdocument-tables/xmlwriter.cpp @@ -0,0 +1,155 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include + +#include "xmlwriter.h" + +QDomDocument *XmlWriter::toXml() +{ + QDomImplementation implementation; + QDomDocumentType docType = implementation.createDocumentType( + "scribe-document", "scribe", "qt.nokia.com/scribe"); + + document = new QDomDocument(docType); + + // ### This processing instruction is required to ensure that any kind + // of encoding is given when the document is written. + QDomProcessingInstruction process = document->createProcessingInstruction( + "xml", "version=\"1.0\" encoding=\"utf-8\""); + document->appendChild(process); + + QDomElement documentElement = document->createElement("document"); + document->appendChild(documentElement); + + QTextFrame *root = textDocument->rootFrame(); + + if (root) + processFrame(documentElement, root); + + return document; +} + +void XmlWriter::processBlock(QDomElement &parent, const QTextBlock &block) +{ + QDomElement blockElement = document->createElement("block"); + blockElement.setAttribute("position", block.position()); + blockElement.setAttribute("length", block.length()); + parent.appendChild(blockElement); + + QTextBlock::iterator it; + for (it = block.begin(); !(it.atEnd()); ++it) { + QTextFragment fragment = it.fragment(); + + if (fragment.isValid()) { + QDomElement fragmentElement = document->createElement("fragment"); + blockElement.appendChild(fragmentElement); + + fragmentElement.setAttribute("length", fragment.length()); + QDomText fragmentText = document->createTextNode(fragment.text()); + + fragmentElement.appendChild(fragmentText); + } + } +} + +void XmlWriter::processFrame(QDomElement &parent, QTextFrame *frame) +{ + QDomElement frameElement = document->createElement("frame"); + frameElement.setAttribute("begin", frame->firstPosition()); + frameElement.setAttribute("end", frame->lastPosition()); + parent.appendChild(frameElement); + +//! [0] + QDomElement frameElement = ... + + QTextFrame::iterator it; + for (it = frame->begin(); !(it.atEnd()); ++it) { + + QTextFrame *childFrame = it.currentFrame(); + QTextBlock childBlock = it.currentBlock(); + + if (childFrame) { + QTextTable *childTable = qobject_cast(childFrame); + + if (childTable) + processTable(frameElement, childTable); + else + processFrame(frameElement, childFrame); + + } else if (childBlock.isValid()) +//! [0] //! [1] + processBlock(frameElement, childBlock); + } +//! [1] +} + +void XmlWriter::processTable(QDomElement &parent, QTextTable *table) +{ + QDomElement element = document->createElement("table"); + + for (int row = 0; row < table->rows(); ++row) { + for (int column = 0; column < table->columns(); ++column) { + QTextTableCell cell = table->cellAt(row, column); + processTableCell(element, cell); + } + } + parent.appendChild(element); +} + +void XmlWriter::processTableCell(QDomElement &parent, const QTextTableCell &cell) +{ + QDomElement element = document->createElement("cell"); + element.setAttribute("row", cell.row()); + element.setAttribute("column", cell.column()); + + QTextFrame::iterator it; + for (it = cell.begin(); !(it.atEnd()); ++it) { + + QTextFrame *childFrame = it.currentFrame(); + QTextBlock childBlock = it.currentBlock(); + + if (childFrame) + processFrame(element, childFrame); + else if (childBlock.isValid()) + processBlock(element, childBlock); + } + parent.appendChild(element); +} diff --git a/src/gui/doc/snippets/textdocument-tables/xmlwriter.h b/src/gui/doc/snippets/textdocument-tables/xmlwriter.h new file mode 100644 index 0000000..33bd83d --- /dev/null +++ b/src/gui/doc/snippets/textdocument-tables/xmlwriter.h @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef XMLWRITER_H +#define XMLWRITER_H + +#include + +class QTextDocument; + +class XmlWriter +{ +public: + XmlWriter(QTextDocument *document) : textDocument(document) {} + QDomDocument *toXml(); + +private: + void processBlock(QDomElement &parent, const QTextBlock &block); + void processFrame(QDomElement &parent, QTextFrame *frame); + void processTable(QDomElement &parent, QTextTable *table); + void processTableCell(QDomElement &parent, const QTextTableCell &cell); + + QDomDocument *document; + QTextDocument *textDocument; +}; + +#endif diff --git a/src/gui/doc/src/richtext.qdoc b/src/gui/doc/src/richtext.qdoc new file mode 100644 index 0000000..b4ba4ba --- /dev/null +++ b/src/gui/doc/src/richtext.qdoc @@ -0,0 +1,1214 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \group richtext-processing + \title Rich Text Processing APIs +*/ + +/*! + \page richtext.html + \title Rich Text Processing + \brief An overview of Qt's rich text processing, editing and display features. + + \ingroup frameworks-technologies + \ingroup qt-basic-concepts + \ingroup best-practices + + \nextpage Rich Text Document Structure + + The Scribe framework provides a set of classes for reading and manipulating + structured rich text documents. Unlike previous rich text support in Qt, the + new classes are centered around the QTextDocument class rather than raw + textual information. This enables the developer to create and modify + structured rich text documents without having to prepare content in an + intermediate markup format. + + The information within a document can be accessed via two complementary + interfaces: A cursor-based interface is used for editing, and a read-only + hierarchical interface provides a high level overview of the document + structure. The main advantage of the cursor-based interface is that the + text can be edited using operations that mimic a user's interaction with + an editor, without losing the underlying structure of the document. The + read-only hierarchical interface is most useful when performing operations + such as searching and document export. + + This document is divided up into chapters for convenient reference: + + \list + \li \l{Rich Text Document Structure} outlines + the different kinds of elements in a QTextDocument, and describes how + they are arranged in a document structure. + \li \l{The QTextCursor Interface} explains how rich + text documents can be edited using the cursor-based interface. + \li \l{Document Layouts} briefly explains the role of document layouts. + \li \l{Common Rich Text Editing Tasks} examines some + common tasks that involve reading or manipulating rich text documents. + \li \l{Advanced Rich Text Processing} examines advanced rich text editing tasks. + \li \l{Supported HTML Subset} lists the HTML tags supported by QTextDocument. + \endlist + + \section1 Rich Text Processing APIs + + Qt provides an extensive collection of classes for parsing, rendering + manipulating and editing rich text. + + \annotatedlist richtext-processing +*/ + +/*! + \page richtext-structure.html + \contentspage richtext.html Contents + \previouspage Rich Text Processing + \nextpage The QTextCursor Interface + + \title Rich Text Document Structure + + \tableofcontents + + Text documents are represented by the QTextDocument class, which + contains information about the document's internal representation, its + structure, and keeps track of modifications to provide undo/redo + facilities. + + The structured representation of a text document presents its contents as + a hierarchy of text blocks, frames, tables, and other objects. These provide + a logical structure to the document and describe how their contents will be + displayed. Generally, frames and tables are used to group other + structures while text blocks contain the actual textual information. + + New elements are created and inserted into the document programmatically + \l{richtext-cursor.html}{with a QTextCursor} or by using an editor + widget, such as QTextEdit. Elements can be given a particular format when + they are created; otherwise they take the cursor's current format for the + element. + + \table + \row + \li \inlineimage richtext-document.png + \li \b{Basic structure} + + The "top level" of a document might be populated in the way shown. + Each document always contains a root frame, and this always contains + at least one text block. + + For documents with some textual content, the root + frame usually contains a sequence of blocks and other elements. + + Sequences of frames and tables are always separated by text blocks in a + document, even if the text blocks contain no information. This ensures that + new elements can always be inserted between existing structures. + \endtable + + In this chapter, we look at each of the structural elements + used in a rich text document, outline their features and uses, and show + how to examine their contents. Document editing is described in + \l{richtext-cursor.html}{The QTextCursor Interface}. + + \section1 Rich Text Documents + + QTextDocument objects contain all the information required to construct + rich text documents. + Text documents can be accessed in two complementary ways: as a linear + buffer for editors to use, and as an object hierarchy that is useful to + layout engines. + In the hierarchical document model, objects generally correspond to + visual elements such as frames, tables, and lists. At a lower level, + these elements describe properties such as the text style and alignment. + The linear representation of the document is used for editing and + manipulation of the document's contents. + + Although QTextEdit makes it easy to display and edit rich text, documents + can also be used independently of any editor widget, for example: + + \snippet code/doc_src_richtext.cpp 0 + + Alternatively, they can be extracted from an existing editor: + + \snippet code/doc_src_richtext.cpp 1 + + This flexibility enables applications to handle multiple rich text + documents without the overhead of multiple editor widgets, or requiring + documents to be stored in some intermediate format. + + An empty document contains a root frame which itself contains a single + empty text block. Frames provide logical separation between parts of the document, but + also have properties that determine how they will appear when rendered. + A table is a specialized type of frame that consists of a number of + cells, arranged into rows and columns, each of which can contain + further structure and text. Tables provide management and layout + features that allow flexible configurations of cells to be created. + + Text blocks contain text fragments, each of which specifies text and + character format information. Textual properties are defined both at + the character level and at the block level. At the character level, + properties such as font family, text color, and font weight can be + specified. The block level properties control the higher level + appearance and behavior of the text, such as the direction of text + flow, alignment, and background color. + + The document structure is not manipulated directly. Editing is + performed through a cursor-based interface. + The \l{richtext-cursor.html}{text cursor interface} + automatically inserts new document elements into the root frame, and + ensures that it is padded with empty blocks where necessary. + + We obtain the root frame in the following manner: + + \snippet textdocument-frames/xmlwriter.h 0 + \snippet textdocument-frames/xmlwriter.cpp 0 + + When navigating the document structure, it is useful to begin at the + root frame because it provides access to the entire document structure. + + + \section1 Document Elements + + Rich text documents usually consist of common elements such as paragraphs, + frames, tables, and lists. These are represented in a QTextDocument + by the QTextBlock, QTextFrame, QTextTable, and QTextList classes. + Unlike the other elements in a document, images are represented by + specially formatted text fragments. This enables them to be placed + formatted inline with the surrounding text. + + The basic structural building blocks in documents are QTextBlock and + QTextFrame. Blocks themselves contain fragments of rich text + (QTextFragment), but these do not directly influence the high level + structure of a document. + + Elements which can group together other document elements are typically + subclasses of QTextObject, and fall into two categories: Elements that + group together text blocks are subclasses of QTextBlockGroup, and those + that group together frames and other elements are subclasses of QTextFrame. + + \section2 Text Blocks + + Text blocks are provided by the QTextBlock class. + + Text blocks group together fragments of text with different character formats, + and are used to represent paragraphs in the document. Each block + typically contains a number of text fragments with different styles. + Fragments are created when text is inserted into the document, and more + of them are added when the document is edited. The document splits, merges, + and removes fragments to efficiently represent the different styles + of text in the block. + + The fragments within a given block can be examined by using a + QTextBlock::iterator to traverse the block's internal structure: + + \snippet textblock-fragments/xmlwriter.cpp 3 + \snippet textblock-fragments/xmlwriter.cpp 5 + \snippet textblock-fragments/xmlwriter.cpp 6 + + Blocks are also used to represent list items. As a result, blocks can + define their own character formats which contain information about + block-level decoration, such as the type of bullet points used for + list items. The formatting for the block itself is described by the + QTextBlockFormat class, and describes properties such as text alignment, + indentation, and background color. + + Although a given document may contain complex structures, once we have a + reference to a valid block in the document, we can navigate between each + of the text blocks in the order in which they were written: + + \snippet textblock-fragments/xmlwriter.cpp 0 + \snippet textblock-fragments/xmlwriter.cpp 1 + \snippet textblock-fragments/xmlwriter.cpp 2 + + This method is useful for when you want to extract just the rich text from a + document because it ignores frames, tables, and other types of structure. + + QTextBlock provides comparison operators that make it easier to manipulate + blocks: \l{QTextBlock::operator==()}{operator==()} and + \l{QTextBlock::operator!=()}{operator!=()} are used to test whether two + blocks are the same, and \l{QTextBlock::operator<()}{operator<()} is used + to determine which one occurs first in a document. + + \section2 Frames + + Frames are provided by the QTextFrame class. + + Text frames group together blocks of text and child frames, creating + document structures that are larger than paragraphs. The format of a frame + specifies how it is rendered and positioned on the page. Frames are + either inserted into the text flow, or they float on the left or right + hand side of the page. + Each document contains a root frame that contains all the other document + elements. As a result, all frames except the root frame have a parent + frame. + + Since text blocks are used to separate other document elements, each + frame will always contain at least one text block, and zero or more + child frames. We can inspect the contents of a frame by using a + QTextFrame::iterator to traverse the frame's child elements: + + \snippet textdocument-frames/xmlwriter.cpp 1 + \snippet textdocument-frames/xmlwriter.cpp 2 + + Note that the iterator selects both frames and blocks, so it is necessary + to check which it is referring to. This allows us to navigate the document + structure on a frame-by-frame basis yet still access text blocks if + required. Both the QTextBlock::iterator and QTextFrame::iterator classes + can be used in complementary ways to extract the required structure from + a document. + + \section2 Tables + + Tables are provided by the QTextTable class. + + Tables are collections of cells that are arranged in rows and columns. + Each table cell is a document element with its own character format, but it + can also contain other elements, such as frames and text blocks. Table cells + are automatically created when the table is constructed, or when extra rows + or columns are added. They can also be moved between tables. + + QTextTable is a subclass of QTextFrame, so tables are treated like frames + in the document structure. For each frame that we encounter in the + document, we can test whether it represents a table, and deal with it in a + different way: + + \snippet textdocument-tables/xmlwriter.cpp 0 + \snippet textdocument-tables/xmlwriter.cpp 1 + + The cells within an existing table can be examined by iterating through + the rows and columns. + + \snippet textdocument-tables/mainwindow.cpp 9 + \snippet textdocument-tables/mainwindow.cpp 10 + \snippet textdocument-tables/mainwindow.cpp 11 + \snippet textdocument-tables/mainwindow.cpp 12 + + + \section2 Lists + + Lists are provided by the QTextList class. + + Lists are sequences of text blocks that are formatted in the usual way, but + which also provide the standard list decorations such as bullet points and + enumerated items. Lists can be nested, and will be indented if the list's + format specifies a non-zero indentation. + + We can refer to each list item by its index in the list: + + \snippet textdocument-listitems/mainwindow.cpp 0 + \snippet textdocument-listitems/mainwindow.cpp 1 + \snippet textdocument-listitems/mainwindow.cpp 2 + + Since QTextList is a subclass of QTextBlockGroup, it does not group the + list items as child elements, but instead provides various functions for + managing them. This means that any text block we find when traversing a + document may actually be a list item. We can ensure that list items are + correctly identified by using the following code: + + \snippet textdocument-listitems/mainwindow.cpp 3 + \snippet textdocument-listitems/mainwindow.cpp 4 + \snippet textdocument-listitems/mainwindow.cpp 5 + \snippet textdocument-listitems/mainwindow.cpp 6 + \snippet textdocument-listitems/mainwindow.cpp 7 + + + \section2 Images + + Images in QTextDocument are represented by text fragments that reference + external images via the resource mechanism. Images are created using the + cursor interface, and can be modified later by changing the character + format of the image's text fragment: + + \snippet textdocument-imageformat/main.cpp 0 + \snippet textdocument-imageformat/main.cpp 1 + \snippet textdocument-imageformat/main.cpp 2 + + The fragment that represents the image can be found by iterating over + the fragments in the text block that contains the image. +*/ + +/*! + \page richtext-cursor.html + \contentspage richtext.html Contents + \previouspage Rich Text Document Structure + \nextpage Document Layouts + + \title The QTextCursor Interface + + \tableofcontents + + Documents can be edited via the interface provided by the QTextCursor + class; cursors are either created using a constructor or obtained from + an editor widget. The cursor is used to perform editing operations that + correspond exactly to those the user is able to make themselves in an + editor. As a result, information about the document structure is also + available through the cursor, and this allows the structure to be + modified. The use of a cursor-oriented interface for editing makes the + process of writing a custom editor simpler for developers, since the + editing operations can be easily visualized. + + The QTextCursor class also maintains information about any text it + has selected in the document, again following a model that is + conceptually similar to the actions made by the user to select text + in an editor. + + Rich text documents can have multiple cursors + associated with them, and each of these contains information about their + position in the document and any selections that they may hold. This + cursor-based paradigm makes common operations, such as cutting and pasting + text, simple to implement programmatically, yet it also allows more complex + editing operations to be performed on the document. + + This chapter describes most of the common editing operations that you + will need to perform using a cursor, from basic insertion of text and + document elements to more complex manipulation of document structures. + + \section1 Cursor-Based Editing + + At the simplest level, text documents are made up of a string of characters, + marked up in some way to represent the block structure of the text within the + document. QTextCursor provides a cursor-based interface that allows the + contents of a QTextDocument to be manipulated at the character level. Since + the elements (blocks, frames, tables, etc.) are also encoded in the character + stream, the document structure can itself be changed by the cursor. + + The cursor keeps track of its location within its parent document, and can + report information about the surrounding structure, such as the enclosing + text block, frame, table, or list. The formats of the enclosing structures + can also be directly obtained through the cursor. + + \section2 Using a Cursor + + The main use of a cursor is to insert or modify text within a block. + We can use a text editor's cursor to do this: + + \snippet textblock-formats/main.cpp 0 + + Alternatively, we can obtain a cursor directly from a document: + + \snippet textdocument-images/main.cpp 0 + + The cursor is positioned at the start of the document so that we can write + into the first (empty) block in the document. + + \section2 Grouping Cursor Operations + + A series of editing operations can be packaged together so that they can + be replayed, or undone together in a single action. This is achieved by + using the \c beginEditBlock() and \c endEditBlock() functions in the + following way, as in the following example where we select the word that + contains the cursor: + + \snippet textdocument-selections/mainwindow.cpp 0 + + If editing operations are not grouped, the document automatically records + the individual operations so that they can be undone later. Grouping + operations into larger packages can make editing more efficient both for + the user and for the application, but care has to be taken not to group too + many operations together as the user may want find-grained control over the + undo process. + + \section2 Multiple Cursors + + Multiple cursors can be used to simultaneously edit the same document, + although only one will be visible to the user in a QTextEdit widget. + The QTextDocument ensures that each cursor writes text correctly and + does not interfere with any of the others. + + \omit + \snippet textdocument-cursors/main.cpp 0 + \snippet textdocument-cursors/main.cpp 1 + \endomit + + \section1 Inserting Document Elements + + QTextCursor provides several functions that can be used to change the + structure of a rich text document. Generally, these functions allow + document elements to be created with relevant formatting information, + and they are inserted into the document at the cursor's position. + + The first group of functions insert block-level elements, and update the + cursor position, but they do not return the element that was inserted: + + \list + \li \l{QTextCursor::insertBlock()}{insertBlock()} inserts a new text block + (paragraph) into a document at the cursor's position, and moves the + cursor to the start of the new block. + \li \l{QTextCursor::insertFragment()}{insertFragment()} inserts an existing + text fragment into a document at the cursor's position. + \li \l{QTextCursor::insertImage()}{insertImage()} inserts an image into a + document at the cursor's position. + \li \l{QTextCursor::insertText()}{insertText()} inserts text into the + document at the cursor's position. + \endlist + + You can examine the contents of the element that was inserted through the + cursor interface. + + The second group of functions insert elements that provide structure to + the document, and return the structure that was inserted: + + \list + \li \l{QTextCursor::insertFrame()}{insertFrame()} inserts a frame into the + document \e after the cursor's current block, and moves the cursor to + the start of the empty block in the new frame. + \li \l{QTextCursor::insertList()}{insertList()} inserts a list into the + document at the cursor's position, and moves the cursor to the start + of the first item in the list. + \li \l{QTextCursor::insertTable()}{insertTable()} inserts a table into + the document \e after the cursor's current block, and moves the cursor + to the start of the block following the table. + \endlist + + These elements either contain or group together other elements in the + document. + + \section2 Text and Text Fragments + + Text can be inserted into the current block in the current character + format, or in a custom format that is specified with the text: + + \snippet textdocument-charformats/main.cpp 0 + + Once the character format has been used with a cursor, that format becomes + the default format for any text inserted with that cursor until another + character format is specified. + + If a cursor is used to insert text without specifying a character format, + the text will be given the character format used at that position in the + document. + + \section2 Blocks + + Text blocks are inserted into the document with the + \l{QTextCursor::insertBlock()}{insertBlock()} function. + + \snippet textblock-formats/main.cpp 1 + + The cursor is positioned at the start of the new block. + + \section2 Frames + + Frames are inserted into a document using the cursor, and will be placed + within the cursor's current frame \e after the current block. + The following code shows how a frame can be inserted between two text + blocks in a document's root frame. We begin by finding the cursor's + current frame: + + \snippet textdocument-frames/mainwindow.cpp 0 + + We insert some text in this frame then set up a frame format for the + child frame: + + \snippet textdocument-frames/mainwindow.cpp 1 + + The frame format will give the frame an external margin of 32 pixels, + internal padding of 8 pixels, and a border that is 4 pixels wide. + See the QTextFrameFormat documentation for more information about + frame formats. + + The frame is inserted into the document after the preceding text: + + \snippet textdocument-frames/mainwindow.cpp 2 + + We add some text to the document immediately after we insert the frame. + Since the text cursor is positioned \e{inside the frame} when it is inserted + into the document, this text will also be inserted inside the frame. + + Finally, we position the cursor outside the frame by taking the last + available cursor position inside the frame we recorded earlier: + + \snippet textdocument-frames/mainwindow.cpp 3 + + The text that we add last is inserted after the child frame in the + document. Since each frame is padded with text blocks, this ensures that + more elements can always be inserted with a cursor. + + \section2 Tables + + Tables are inserted into the document using the cursor, and will be + placed within the cursor's current frame \e after the current block: + + \snippet textdocument-tables/mainwindow.cpp 0 + \snippet textdocument-tables/mainwindow.cpp 3 + + Tables can be created with a specific format that defines the overall + properties of the table, such as its alignment, background color, and + the cell spacing used. It can also determine the constraints on each + column, allowing each of them to have a fixed width, or resize according + to the available space. + + \snippet textdocument-tables/mainwindow.cpp 2 + + The columns in the table created above will each take up a certain + percentage of the available width. Note that the table format is + optional; if you insert a table without a format, some sensible + default values will be used for the table's properties. + + Since cells can contain other document elements, they too can be + formatted and styled as necessary. + + Text can be added to the table by navigating to each cell with the cursor + and inserting text. + + \snippet textdocument-tables/mainwindow.cpp 4 + + We can create a simple timetable by following this approach: + + \snippet textdocument-tables/mainwindow.cpp 5 + \snippet textdocument-tables/mainwindow.cpp 6 + \snippet textdocument-tables/mainwindow.cpp 7 + \snippet textdocument-tables/mainwindow.cpp 8 + + \section2 Lists + + Lists of block elements can be automatically created and inserted into the + document at the current cursor position. Each list that is created in this + way requires a list format to be specified: + + \snippet textdocument-lists/mainwindow.cpp 0 + + The above code first checks whether the cursor is within an existing list + and, if so, gives the list format for the new list a suitable level of + indentation. This allows nested lists to be created with increasing + levels of indentation. A more sophisticated implementation would also use + different kinds of symbol for the bullet points in each level of the list. + + \section2 Images + + Inline images are added to documents through the cursor in the usual manner. + Unlike many other elements, all of the image properties are specified by the + image's format. This means that a QTextImageFormat object has to be + created before an image can be inserted: + + \snippet textdocument-images/main.cpp 1 + + The image name refers to an entry in the application's resource file. + The method used to derive this name is described in + \l{resources.html}{The Qt Resource System}. + + \section1 Examples + + Rich text is stored in text documents that can either be created by + importing HTML from an external source, or generated using a QTextCursor. + + \section2 Manipulating Rich Text + + The easiest way to use a rich text document is through + the QTextEdit class, providing an editable view onto a document. The code + below imports HTML into a document, and displays the document using a + text edit widget. + + \snippet scribe-overview/main.cpp 1 + + You can retrieve the document from the text edit using the + document() function. The document can then be edited programmatically + using the QTextCursor class. This class is modeled after a screen + cursor, and editing operations follow the same semantics. The following + code changes the first line of the document to a bold font, leaving all + other font properties untouched. The editor will be automatically + updated to reflect the changes made to the underlying document data. + + \snippet scribe-overview/main.cpp 0 + + Note that the cursor was moved from the start of the first line to the + end, but that it retained an anchor at the start of the line. This + demonstrates the cursor-based selection facilities of the + QTextCursor class. + + \section2 Generating a Calendar + + Rich text can be generated very quickly using the cursor-based + approach. The following example shows a simple calendar in a + QTextEdit widget with bold headers for the days of the week: + + \snippet textdocument-blocks/mainwindow.cpp 0 + \codeline + \snippet textdocument-blocks/mainwindow.cpp 1 + \snippet textdocument-blocks/mainwindow.cpp 2 + \snippet textdocument-blocks/mainwindow.cpp 3 + + The above example demonstrates how simple it is to quickly generate new + rich text documents using a minimum amount of code. Although we have + generated a crude fixed-pitch calendar to avoid quoting too much code, + Scribe provides much more sophisticated layout and formatting features. +*/ + +/*! + \page richtext-layouts.html + \contentspage richtext.html Contents + \previouspage The QTextCursor Interface + \nextpage Common Rich Text Editing Tasks + + \title Document Layouts + + \tableofcontents + + The layout of a document is only relevant when it is to be displayed on + a device, or when some information is requested that requires a visual + representation of the document. Until this occurs, the document does + not need to be formatted and prepared for a device. + + \section1 Overview + + Each document's layout is managed by a subclass of the + QAbstractTextDocumentLayout class. This class provides a common + interface for layout and rendering engines. The default rendering + behavior is currently implemented in a private class. This approach + makes it possible to create custom layouts, and provides the + mechanism used when preparing pages for printing or exporting to + Portable Document Format (PDF) files. + + \section1 Example - Shaped Text Layout + + Sometimes it is important to be able to format plain text within an + irregularly-shaped region, perhaps when rendering a custom widget, for + example. Scribe provides generic features, such as those provided by + the QTextLayout class, to help developers perform word-wrapping and + layout tasks without the need to create a document first. + + \image plaintext-layout.png + + Formatting and drawing a paragraph of plain text is straightforward. + The example below will lay out a paragraph of text, using a single + font, around the right hand edge of a circle. + + \snippet plaintextlayout/window.cpp 0 + + We create a text layout, specifying the text string we want to display + and the font to use. We ensure that the text we supplied is formatted + correctly by obtaining text lines from the text format, and wrapping + the remaining text using the available space. The lines are positioned + as we move down the page. + + The formatted text can be drawn onto a paint device; in the above code, + the text is drawn directly onto a widget. + */ + + /*! + \page richtext-common-tasks.html + \contentspage richtext.html Contents + \previouspage Document Layouts + \nextpage Advanced Rich Text Processing + + \title Common Rich Text Editing Tasks + + \tableofcontents + + There are a number of tasks that are often performed by developers + when editing and processing text documents using Qt. These include the use + of display widgets such as QTextBrowser and QTextEdit, creation of + documents with QTextDocument, editing using a QTextCursor, and + exporting the document structure. + This document outlines some of the more common ways of using the rich + text classes to perform these tasks, showing convenient patterns that can + be reused in your own applications. + + \section1 Using QTextEdit + + A text editor widget can be constructed and used to display HTML in the + following way: + + \snippet code/doc_src_richtext.cpp 2 + + By default, the text editor contains a document with a root frame, inside + which is an empty text block. This document can be obtained so that it can + be modified directly by the application: + + \snippet code/doc_src_richtext.cpp 3 + + The text editor's cursor may also be used to edit a document: + + \snippet code/doc_src_richtext.cpp 4 + + Although a document can be edited using many cursors at once, a QTextEdit + only displays a single cursor at a time. Therefore, if we want to update the + editor to display a particular cursor or its selection, we need to set the + editor's cursor after we have modified the document: + + \snippet code/doc_src_richtext.cpp 5 + + \section1 Selecting Text + + Text is selected by moving the cursor using operations that are similar to + those performed by a user in a text editor. To select text between two + points in the document, we need to position the cursor at the first point + then move it using a special mode (\l{QTextCursor::MoveMode}) with a + move operation (\l{QTextCursor::MoveOperation}). + When we select the text, we leave the selection anchor at the old cursor + position just as the user might do by holding down the Shift key when + selecting text: + + \snippet textdocument-selections/mainwindow.cpp 1 + + In the above code, a whole word is selected using this method. QTextCursor + provides a number of common move operations for selecting individual + characters, words, lines, and whole blocks. + + \section1 Finding Text + + QTextDocument provides a cursor-based interface for searching, making + it easy to find and modify text in the style of a text editor. The following + code finds all the instances of a particular word in a document, and changes + the color of each: + + \snippet textdocument-find/main.cpp 0 + \snippet textdocument-find/main.cpp 1 + + Note that the cursor does not have to be moved after each search and replace + operation; it is always positioned at the end of the word that was just + replaced. + + \section1 Printing Documents + + QTextEdit is designed for the display of large rich text documents that are + read on screen, rendering them in the same way as a web browser. As a result, + it does not automatically break the contents of the document into page-sized + pieces that are suitable for printing. + + QTextDocument provides a \l{QTextDocument::print()}{print()} function to + allow documents to be printed using the QPrinter class. The following code + shows how to prepare a document in a QTextEdit for printing with a QPrinter: + + \snippet textdocument-printing/mainwindow.cpp 0 + + The document is obtained from the text editor, and a QPrinter is constructed + then configured using a QPrintDialog. If the user accepts the printer's + configuration then the document is formatted and printed using the + \l{QTextDocument::print()}{print()} function. +*/ + +/*! + \page richtext-advanced-processing.html + \contentspage richtext.html Contents + \previouspage Common Rich Text Editing Tasks + \nextpage Supported HTML Subset + + \title Advanced Rich Text Processing + + \section1 Handling Large Files + + Qt does not limit the size of files that are used for text + processing. In most cases, this will not present a problem. For + especially large files, however, you might experience that your + application will become unresponsive or that you will run out of + memory. The size of the files you can load depends on your + hardware and on Qt's and your own application's implementation. + + If you are faced with this problem, we recommend that you address the + following issues: + + \list + \li You should consider breaking up large paragraphs into smaller + ones as Qt handles small paragraphs better. You could also + insert line breaks at regular intervals, which will look the + same as one large paragraph in a QTextEdit. + \li You can reduce the amount of blocks in a QTextDocument with + \l{QTextDocument::}{maximumBlockCount()}. The document is only + as large as the number of blocks as far as QTextEdit is concerned. + \li When adding text to a text edit, it is an advantage to add it + in an edit block (see example below). The result is that the + text edit does not need to build the entire document structure at once. + \endlist + + We give an example of the latter technique from the list. We assume that + the text edit is visible. + + \snippet code/doc_src_richtext.cpp 6 + + \omit + Ideas for other sections: + + * Hiding QTextBlock elements. + * Changing the word wrapping mode in QTextEdit. Custom word wrapping? + \endomit +*/ + +/*! + \page richtext-html-subset.html + \title Supported HTML Subset + \brief Describes the support for HTML markup in text widgets. + + \contentspage richtext.html Contents + \previouspage Common Rich Text Editing Tasks + + Qt's text widgets are able to display rich text, specified using a subset of \l{HTML 4} + markup. Widgets that use QTextDocument, such as QLabel and QTextEdit, are able to display + rich text specified in this way. + + \tableofcontents + + \section1 Using HTML Markup in Text Widgets + + Widgets automatically detect HTML markup and display rich text accordingly. For example, + setting a label's \l{QLabel::}{text} property with the string \c{"Hello Qt!"} + will result in the label displaying text like this: \b{Hello} \e{Qt!} + + When HTML markup is used for text, Qt follows the rules defined by the \l{HTML 4} + specification. This includes default properties for text layout, such as the + direction of the text flow (left-to-right) which can be changed by applying the + \l{#Block Attributes}{\c dir} attribute to blocks of text. + + \section1 Supported Tags + + The following table lists the HTML tags supported by Qt's + \l{Rich Text Processing}{rich text} engine: + + \table + \header \li Tag + \li Description + \li Comment + \row \li \c a + \li Anchor or link + \li Supports the \c href and \c name attributes. + \row \li \c address + \li Address + \li + \row \li \c b + \li Bold + \li + \row \li \c big + \li Larger font + \li + \row \li \c blockquote + \li Indented paragraph + \li + \row \li \c body + \li Document body + \li Supports the \c bgcolor attribute, which + can be a Qt \l{QColor::setNamedColor()}{color name} + or a \c #RRGGBB color specification. + \row \li \c br + \li Line break + \li + \row \li \c center + \li Centered paragraph + \li + \row \li \c cite + \li Inline citation + \li Same as \c i. + \row \li \c code + \li Code + \li Same as \c tt. + \row \li \c dd + \li Definition data + \li + \row \li \c dfn + \li Definition + \li Same as \c i. + \row \li \c div + \li Document division + \li Supports the standard \l{block attributes}. + \row \li \c dl + \li Definition list + \li Supports the standard \l{block attributes}. + \row \li \c dt + \li Definition term + \li Supports the standard \l{block attributes}. + \row \li \c em + \li Emphasized + \li Same as \c i. + \row \li \c font + \li Font size, family, and/or color + \li Supports the following attributes: + \c size, \c face, and \c color (Qt + \l{QColor::setNamedColor()}{color names} or + \c #RRGGBB). + \row \li \c h1 + \li Level 1 heading + \li Supports the standard \l{block attributes}. + \row \li \c h2 + \li Level 2 heading + \li Supports the standard \l{block attributes}. + \row \li \c h3 + \li Level 3 heading + \li Supports the standard \l{block attributes}. + \row \li \c h4 + \li Level 4 heading + \li Supports the standard \l{block attributes}. + \row \li \c h5 + \li Level 5 heading + \li Supports the standard \l{block attributes}. + \row \li \c h6 + \li Level 6 heading + \li Supports the standard \l{block attributes}. + \row \li \c head + \li Document header + \li + \row \li \c hr + \li Horizontal line + \li Supports the \c width attribute, which can + be specified as an absolute or relative (\c %) value. + \row \li \c html + \li HTML document + \li + \row \li \c i + \li Italic + \li + \row \li \c img + \li Image + \li Supports the \c src, \c source + (for Qt 3 compatibility), \c width, and \c height + attributes. + \row \li \c kbd + \li User-entered text + \li + \row \li \c meta + \li Meta-information + \li If a text encoding is specified using the \c{meta} tag, + it is picked up by Qt::codecForHtml(). + Likewise, if an encoding is specified to + QTextDocument::toHtml(), the encoding is stored using + a \c meta tag, for example: + + \snippet code/doc_src_richtext.qdoc 7 + + \row \li \c li + \li List item + \li + \row \li \c nobr + \li Non-breakable text + \li + \row \li \c ol + \li Ordered list + \li Supports the standard \l{list attributes}. + \row \li \c p + \li Paragraph + \li Left-aligned by default. Supports the standard + \l{block attributes}. + \row \li \c pre + \li Preformated text + \li + \row \li \c qt + \li Qt rich-text document + \li Synonym for \c html. Provided for compatibility with + earlier versions of Qt. + \row \li \c s + \li Strikethrough + \li + \row \li \c samp + \li Sample code + \li Same as \c tt. + \row \li \c small + \li Small font + \li + \row \li \c span + \li Grouped elements + \li + \row \li \c strong + \li Strong + \li Same as \c b. + \row \li \c sub + \li Subscript + \li + \row \li \c sup + \li Superscript + \li + \row \li \c table + \li Table + \li Supports the following attributes: \c border, + \c bgcolor (Qt \l{QColor::setNamedColor()}{color names} + or \c #RRGGBB), \c cellspacing, \c cellpadding, + \c width (absolute or relative), and \c height. + \row \li \c tbody + \li Table body + \li Does nothing. + \row \li \c td + \li Table data cell + \li Supports the standard \l{table cell attributes}. + \row \li \c tfoot + \li Table footer + \li Does nothing. + \row \li \c th + \li Table header cell + \li Supports the standard \l{table cell attributes}. + \row \li \c thead + \li Table header + \li If the \c thead tag is specified, it is used when printing tables + that span multiple pages. + \row \li \c title + \li Document title + \li The value specified using the \c + title tag is available through + QTextDocument::metaInformation(). + \row \li \c tr + \li Table row + \li Supports the \c bgcolor attribute, which + can be a Qt \l{QColor::setNamedColor()}{color name} + or a \c #RRGGBB color specification. + \row \li \c tt + \li Typewrite font + \li + \row \li \c u + \li Underlined + \li + \row \li \c ul + \li Unordered list + \li Supports the standard \l{list attributes}. + \row \li \c var + \li Variable + \li Same as \c i. + \endtable + + \section1 Block Attributes + + The following attributes are supported by the \c div, \c dl, \c + dt, \c h1, \c h2, \c h3, \c h4, \c h5, \c h6, \c p tags: + + \list + \li \c align (\c left, \c right, \c center, \c justify) + \li \c dir (\c ltr, \c rtl) + \endlist + + \section1 List Attributes + + The following attribute is supported by the \c ol and \c ul tags: + + \list + \li \c type (\c 1, \c a, \c A, \c square, \c disc, \c circle) + \endlist + + \section1 Table Cell Attributes + + The following attributes are supported by the \c td and \c th + tags: + + \list + \li \c width (absolute, relative, or no-value) + \li \c bgcolor (Qt \l{QColor::setNamedColor()}{color names} or \c #RRGGBB) + \li \c colspan + \li \c rowspan + \li \c align (\c left, \c right, \c center, \c justify) + \li \c valign (\c top, \c middle, \c bottom) + \endlist + + \section1 CSS Properties + The following table lists the CSS properties supported by Qt's + \l{Rich Text Processing}{rich text} engine: + + \table + \header \li Property + \li Values + \li Description + \row + \li \c background-color + \li + \li Background color for elements + \row + \li \c background-image + \li + \li Background image for elements + \row \li \c color + \li + \li Text foreground color + \row \li \c font-family + \li + \li Font family name + \row \li \c font-size + \li [ small | medium | large | x-large | xx-large ] | pt | px + \li Font size relative to the document font, or specified in points or pixels + \row \li \c font-style + \li [ normal | italic | oblique ] + \li + \row \li \c font-weight + \li [ normal | bold | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 ] + \li Specifies the font weight used for text, where \c normal and \c bold + are mapped to the corresponding QFont weights. Numeric values are + 8 times the equivalent QFont weight values. + \row \li \c text-decoration + \li none | [ underline || overline || line-through ] + \li Additional text effects + \row \li \c font + \li [ [ <'font-style'> || <'font-weight'> ]? <'font-size'> <'font-family'> ] + \li Font shorthand property + \row \li \c text-indent + \li px + \li First line text indentation in pixels + \row \li \c white-space + \li normal | pre | nowrap | pre-wrap + \li Declares how whitespace in HTML is handled. + \row \li \c margin-top + \li px + \li Top paragraph margin in pixels + \row \li \c margin-bottom + \li px + \li Bottom paragraph margin in pixels + \row \li \c margin-left + \li px + \li Left paragraph margin in pixels + \row \li \c margin-right + \li px + \li Right paragraph margin in pixels + \row \li \c padding-top + \li px + \li Top table cell padding in pixels + \row \li \c padding-bottom + \li px + \li Bottom table cell padding in pixels + \row \li \c padding-left + \li px + \li Left table cell padding in pixels + \row \li \c padding-right + \li px + \li Right table cell padding in pixels + \row \li \c padding + \li px + \li Shorthand for setting all the padding properties at once. + \row \li \c vertical-align + \li baseline | sub | super | middle | top | bottom + \li Vertical text alignment. For vertical alignment in text table cells only middle, top, and bottom apply. + \row \li \c border-color + \li + \li Border color for text tables. + \row \li \c border-style + \li none | dotted | dashed | dot-dash | dot-dot-dash | solid | double | groove | ridge | inset | outset + \li Border style for text tables. + \row \li \c background + \li [ <'background-color'> || <'background-image'> ] + \li Background shorthand property + \row \li \c page-break-before + \li [ auto | always ] + \li Make it possible to enforce a page break before the paragraph/table + \row \li \c page-break-after + \li [ auto | always ] + \li Make it possible to enforce a page break after the paragraph/table + \row \li float + \li [ left | right | none ] + \li Specifies where an image or a text will be placed in another element. Note that the \c float property is + only supported for tables and images. + \row \li \c text-transform + \li [ uppercase | lowercase ] + \li Select the transformation that will be performed on the text prior to displaying it. + \row \li \c font-variant + \li small-caps + \li Perform the smallcaps transformation on the text prior to displaying it. + \row \li \c word-spacing + \li px + \li Specifies an alternate spacing between each word. + \endtable + + \section1 Supported CSS Selectors + + All CSS 2.1 selector classes are supported except pseudo-class selectors such + as \c{:first-child}, \c{:visited} and \c{:hover}. + +*/ -- 2.7.4