Sophie

Sophie

distrib > Fedora > 18 > i386 > by-pkgid > 5ab010e37991249ab4adaa24d6e39c6e > files > 225

qt5-qtdoc-5.1.1-2.fc18.noarch.rpm

<?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" />
<!-- graphics.qdoc -->
  <title>Graphics | QtDoc 5.1</title>
  <link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader"></div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#2d-graphics-with-qpainter">2D graphics with QPainter</a></li>
<li class="level1"><a href="#opengl-and-3d">OpenGL and 3D</a></li>
<li class="level1"><a href="#qt-quick-scene-graph">Qt Quick scene graph</a></li>
<li class="level1"><a href="#printing">Printing</a></li>
<li class="level1"><a href="#images">Images</a></li>
</ul>
</div>
<h1 class="title">Graphics</h1>
<span class="subtitle"></span>
<!-- $$$topics-graphics.html-description -->
<div class="descr"> <a name="details"></a>
<p>Graphics in Qt 5 is primarily done either through the imperative QPainter API, or through Qt’s declarative UI language, Qt Quick, and its scene graph back-end. Qt 5's graphics capabilities also includes support for printing, as well as the loading and saving of various image formats.</p>
<a name="2d-graphics-with-qpainter"></a>
<h2>2D graphics with QPainter</h2>
<p>QPainter provides API for drawing vector graphics, text and images onto different surfaces, or QPaintDevice instances, such as QImage, <a href="whatsnew50.html#qopenglpaintdevice">QOpenGLPaintDevice</a>, QWidget, and QPrinter. The actual drawing happens in the QPaintDevice's QPaintEngine. The software rasterizer and the OpenGL (ES) 2.0 back-ends are the two most important QPaintEngine implementations. The raster paint engine is Qt’s software rasterizer, and is used when drawing on a QImage or QWidget. Its strength over the OpenGL paint engine is its high quality when antialiasing is enabled, and a complete feature set.</p>
<ul>
<li>Paint System - Overview over the QPainter classes and architecture.</li>
<li>Coordinate System - Explains how QPainter's coordinate system works.</li>
<li>Drawing and Filling - Explains how QPainter performs filling and outlining of vector shapes.</li>
</ul>
<p>The most important rendering targets for QPainter are:</p>
<ul>
<li>QImage - A hardware-independent image representation with direct pixel access. QPainter will use the software rasterizer to draw to QImage instances.</li>
<li>QPixmap - A image representation suited for display on screen. QPainter will primarily use the software rasterizer to draw to QPixmap instances.</li>
<li><a href="whatsnew50.html#qopenglpaintdevice">QOpenGLPaintDevice</a> - A paint device to render to the current OpenGL (ES) 2.0 context. QPainter will use hardware accellerated OpenGL calls to draw to <a href="whatsnew50.html#qopenglpaintdevice">QOpenGLPaintDevice</a> instances.</li>
<li>QBackingStore - A backbuffer for top-level windows. QPainter will primarily use the software rasterizer to draw to QBackingStore instances.</li>
<li>QWidget - A baseclass for pre-Qt Quick user interface classes. QPainter will render widgets using a QBackingStore.</li>
</ul>
<p>QPainter and related classes are part of the Qt GUI module, which is described in further detail on the <a href="whatsnew51.html#qt-gui">Qt GUI</a> page.</p>
<a name="opengl-and-3d"></a>
<h2>OpenGL and 3D</h2>
<p>OpenGL is the most widely adopted graphics API for hardware accelerated and 3D graphics, implemented on all desktop platforms and almost every mobile and embedded platform. The Qt library contains a number of classes that help users integrate OpenGL into their applications.</p>
<ul>
<li>OpenGL in QtGui - An overview of how OpenGL integrates with the Qt GUI Module.</li>
<li>OpenGL and Qt Quick 2.0 - How to integrate OpenGL into a the Qt Quick 2.0 scene graph.</li>
<li><a href="http://www.khronos.org/opengl">www.khronos.org/opengl</a> - The offical OpenGL pages.</li>
</ul>
<p>Prior to Qt 5.0, OpenGL support in Qt was handled by the <a href="addons.html#qt-opengl-module">Qt OpenGL Module</a>. This module is still present, but new code should aim to use the new classes in the Qt GUI Module.</p>
<a name="qt-quick-scene-graph"></a>
<h2>Qt Quick scene graph</h2>
<p>Qt Quick 2.0 introduces an OpenGL (ES) 2.0 scene graph for rendering. It generally improves the performance of Qt Quick 2.0 significantly compared to the QGraphicsView/QPainter-based apprach used in earlier versions.</p>
<p>The scene graph is a graphical representation of the Item scene. It can be thought of as a graphical deep copy, an independent structure that contains enough information to render all the items. Once it has been set up, it can be manipulated and rendered independently of the state of the items. On many platforms, the scene graph will even be rendered on a dedicated render thread while the GUI thread is preparing the next frame's state.</p>
<p>The scene graph is used when you import QtQuick 2.0 in your QML file, and use QQuickView to run it.</p>
<ul>
<li>Qt Quick Scene Graph - Overview of the Qt Quick Scene Graph architecture.</li>
<li>Scene Graph and Rendering - Breakdown of the rendering of each frame.</li>
</ul>
<p>Qt Quick can be mixed with raw OpenGL rendering by connecting to the signals QQuickWindow::beforeRendering() or QQuickWindow::afterRendering() which are emitted before and after the Qt Quick scene graph is rendered, respectively. There signals are emitted from the render thread (when applicable), and the connections need to be direct.</p>
<a name="printing"></a>
<h2>Printing</h2>
<p>Qt supports printing both directly to actual printers, locally or on the network, as well as producing PDF output. How to do printing with Qt is described in detail on the Qt Print Support page.</p>
<p>To be able to access the Qt printing classes from your application or library, see the Qt Print Support module page.</p>
<a name="images"></a>
<h2>Images</h2>
<p>Qt supports convenient reading, writing, and manipulating of images through the QImage class. In addition, for more fine grained control of how images are loaded or saved, you can use the QImageReader and QImageWriter classes respectively. To add support for additional image formats, outside of the ones provided by Qt, you can create image format plugins by using QImageIOHandler and QImageIOPlugin.</p>
<p>See the Reading and Writing Image Files page for more information.</p>
</div>
<p><b>See also </b>Paint System.</p>
<!-- @@@topics-graphics.html -->
</div>
</div>
</div>
<div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      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.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      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. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>