/usr/share/qt5/doc/qtquick/qtquick-canvas-example.html is in qtdeclarative5-doc-html 5.2.1-3ubuntu15.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- canvas.qdoc -->
<title>Qt Quick Examples - Canvas | QtQuick 5.2</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<ul>
<li>Qt 5.2</li>
<li><a href="qtquick-index.html">Qt Quick</a></li>
<li>Qt Quick Examples - Canvas</li>
<li id="buildversion">
Qt 5.2.1 Reference Documentation</li>
</ul>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<h1 class="title">Qt Quick Examples - Canvas</h1>
<span class="subtitle"></span>
<!-- $$$canvas-description -->
<div class="descr"> <a name="details"></a>
<p>This is a collection of QML Canvas examples.<p class="centerAlign"><img src="images/qml-canvas-example.png" alt="" /></p><p>This is a collection of small QML examples relating to Canvas item. Each example is a small QML file emphasizing a particular type or feature.</p>
<p>Red heart demonstrates using a bezierCurve API to stroke and fill a red heart.</p>
<pre class="qml"><span class="name">ctx</span>.<span class="name">beginPath</span>();
<span class="name">ctx</span>.<span class="name">moveTo</span>(<span class="number">75</span>,<span class="number">40</span>);
<span class="name">ctx</span>.<span class="name">bezierCurveTo</span>(<span class="number">75</span>,<span class="number">37</span>,<span class="number">70</span>,<span class="number">25</span>,<span class="number">50</span>,<span class="number">25</span>);
<span class="name">ctx</span>.<span class="name">bezierCurveTo</span>(<span class="number">20</span>,<span class="number">25</span>,<span class="number">20</span>,<span class="number">62.5</span>,<span class="number">20</span>,<span class="number">62.5</span>);
<span class="name">ctx</span>.<span class="name">bezierCurveTo</span>(<span class="number">20</span>,<span class="number">80</span>,<span class="number">40</span>,<span class="number">102</span>,<span class="number">75</span>,<span class="number">120</span>);
<span class="name">ctx</span>.<span class="name">bezierCurveTo</span>(<span class="number">110</span>,<span class="number">102</span>,<span class="number">130</span>,<span class="number">80</span>,<span class="number">130</span>,<span class="number">62.5</span>);
<span class="name">ctx</span>.<span class="name">bezierCurveTo</span>(<span class="number">130</span>,<span class="number">62.5</span>,<span class="number">130</span>,<span class="number">25</span>,<span class="number">100</span>,<span class="number">25</span>);
<span class="name">ctx</span>.<span class="name">bezierCurveTo</span>(<span class="number">85</span>,<span class="number">25</span>,<span class="number">75</span>,<span class="number">37</span>,<span class="number">75</span>,<span class="number">40</span>);
<span class="name">ctx</span>.<span class="name">closePath</span>();</pre>
<p>Talk bubble demonstrates using a quadraticCurveTo API to stroke and fill a customized talk bubble:</p>
<pre class="qml"><span class="name">ctx</span>.<span class="name">beginPath</span>();
<span class="name">ctx</span>.<span class="name">moveTo</span>(<span class="number">75</span>,<span class="number">25</span>);
<span class="name">ctx</span>.<span class="name">quadraticCurveTo</span>(<span class="number">25</span>,<span class="number">25</span>,<span class="number">25</span>,<span class="number">62.5</span>);
<span class="name">ctx</span>.<span class="name">quadraticCurveTo</span>(<span class="number">25</span>,<span class="number">100</span>,<span class="number">50</span>,<span class="number">100</span>);
<span class="name">ctx</span>.<span class="name">quadraticCurveTo</span>(<span class="number">50</span>,<span class="number">120</span>,<span class="number">30</span>,<span class="number">125</span>);
<span class="name">ctx</span>.<span class="name">quadraticCurveTo</span>(<span class="number">60</span>,<span class="number">120</span>,<span class="number">65</span>,<span class="number">100</span>);
<span class="name">ctx</span>.<span class="name">quadraticCurveTo</span>(<span class="number">125</span>,<span class="number">100</span>,<span class="number">125</span>,<span class="number">62.5</span>);
<span class="name">ctx</span>.<span class="name">quadraticCurveTo</span>(<span class="number">125</span>,<span class="number">25</span>,<span class="number">75</span>,<span class="number">25</span>);
<span class="name">ctx</span>.<span class="name">closePath</span>();</pre>
<p>This example also demonstrates the fillText API:</p>
<pre class="qml"><span class="name">ctx</span>.<span class="name">fillStyle</span> <span class="operator">=</span> <span class="string">"white"</span>;
<span class="name">ctx</span>.<span class="name">font</span> <span class="operator">=</span> <span class="string">"Bold 17px"</span>;
<span class="name">ctx</span>.<span class="name">fillText</span>(<span class="string">"Qt Quick"</span>, <span class="number">40</span>, <span class="number">70</span>);</pre>
<p>Squircle demonstrates using a collection of simple moveTo/lineTo path APIs to draw a smooth squircle.</p>
<p>Rounded rectangle demonstrates using a collection if lineTo/arcTo path APIs to draw a rounded rectangle.</p>
<p>Smile face demonstrates using several complex path APIs to draw an fill a smile face.</p>
<p>Clip demonstrates using clip API to clip a given image.</p>
<pre class="qml"><span class="name">ctx</span>.<span class="name">clip</span>();
<span class="name">ctx</span>.<span class="name">drawImage</span>(<span class="name">canvas</span>.<span class="name">imagefile</span>, <span class="number">0</span>, <span class="number">0</span>);</pre>
<p>Tiger demonstrates using SVG path API to draw a tiger with a collection of SVG path strings.</p>
<pre class="qml"><span class="keyword">for</span> (<span class="keyword">var</span> <span class="name">i</span> = <span class="number">0</span>; <span class="name">i</span> <span class="operator"><</span> <span class="name">Tiger</span>.<span class="name">tiger</span>.<span class="name">length</span>; i++) {
<span class="keyword">if</span> (<span class="name">Tiger</span>.<span class="name">tiger</span>[<span class="name">i</span>].<span class="name">width</span> <span class="operator">!=</span> <span class="name">undefined</span>)
<span class="name">ctx</span>.<span class="name">lineWidth</span> <span class="operator">=</span> <span class="name">Tiger</span>.<span class="name">tiger</span>[<span class="name">i</span>].<span class="name">width</span>;
<span class="keyword">if</span> (<span class="name">Tiger</span>.<span class="name">tiger</span>[<span class="name">i</span>].<span class="name">path</span> <span class="operator">!=</span> <span class="name">undefined</span>)
<span class="name">ctx</span>.<span class="name">path</span> <span class="operator">=</span> <span class="name">Tiger</span>.<span class="name">tiger</span>[<span class="name">i</span>].<span class="name">path</span>;
<span class="keyword">if</span> (<span class="name">Tiger</span>.<span class="name">tiger</span>[<span class="name">i</span>].<span class="name">fill</span> <span class="operator">!=</span> <span class="name">undefined</span>) {
<span class="name">ctx</span>.<span class="name">fillStyle</span> <span class="operator">=</span> <span class="name">Tiger</span>.<span class="name">tiger</span>[<span class="name">i</span>].<span class="name">fill</span>;
<span class="name">ctx</span>.<span class="name">fill</span>();
}
<span class="keyword">if</span> (<span class="name">Tiger</span>.<span class="name">tiger</span>[<span class="name">i</span>].<span class="name">stroke</span> <span class="operator">!=</span> <span class="name">undefined</span>) {
<span class="name">ctx</span>.<span class="name">strokeStyle</span> <span class="operator">=</span> <span class="name">Tiger</span>.<span class="name">tiger</span>[<span class="name">i</span>].<span class="name">stroke</span>;
<span class="name">ctx</span>.<span class="name">stroke</span>();
}
}</pre>
<p>Files:</p>
<ul>
<li><a href="qtquick-canvas-canvas-qml.html">canvas/canvas.qml</a></li>
<li><a href="qtquick-canvas-beziercurve-beziercurve-qml.html">canvas/bezierCurve/bezierCurve.qml</a></li>
<li><a href="qtquick-canvas-clip-clip-qml.html">canvas/clip/clip.qml</a></li>
<li><a href="qtquick-canvas-quadraticcurveto-quadraticcurveto-qml.html">canvas/quadraticCurveTo/quadraticCurveTo.qml</a></li>
<li><a href="qtquick-canvas-roundedrect-roundedrect-qml.html">canvas/roundedrect/roundedrect.qml</a></li>
<li><a href="qtquick-canvas-smile-smile-qml.html">canvas/smile/smile.qml</a></li>
<li><a href="qtquick-canvas-squircle-squircle-qml.html">canvas/squircle/squircle.qml</a></li>
<li><a href="qtquick-canvas-tiger-tiger-js.html">canvas/tiger/tiger.js</a></li>
<li><a href="qtquick-canvas-tiger-tiger-qml.html">canvas/tiger/tiger.qml</a></li>
<li><a href="qtquick-canvas-main-cpp.html">canvas/main.cpp</a></li>
<li><a href="qtquick-canvas-canvas-pro.html">canvas/canvas.pro</a></li>
<li><a href="qtquick-canvas-canvas-qrc.html">canvas/canvas.qrc</a></li>
</ul>
</div>
<!-- @@@canvas -->
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. </p>
</div>
</body>
</html>
|