Sophie

Sophie

distrib > Mageia > 6 > i586 > by-pkgid > f93881942bd3805980c2fe63aa853d78 > files > 282

qtdoc5-5.9.4-1.mga6.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- userinterfaces.qdoc -->
  <title>User Interfaces | Qt 5.9</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="index.html">Qt 5.9</a></td><td >User Interfaces</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level2"><a href="#common-important-ui-topics">Common Important UI Topics</a></li>
<li class="level1"><a href="#qml-graphical-user-interfaces">QML Graphical User Interfaces</a></li>
<li class="level2"><a href="#important-ui-topics-for-qml-applications">Important UI Topics for QML Applications</a></li>
<li class="level2"><a href="#graphical-controls">Graphical Controls</a></li>
<li class="level1"><a href="#widget-based-user-interfaces">Widget-based User Interfaces</a></li>
<li class="level2"><a href="#important-concepts-in-qt-widgets">Important Concepts in Qt Widgets</a></li>
<li class="level1"><a href="#visualizing-data">Visualizing Data</a></li>
<li class="level1"><a href="#displaying-web-content">Displaying Web Content</a></li>
<li class="level1"><a href="#comparison">Comparison</a></li>
<li class="level1"><a href="#internationalization-and-translations">Internationalization and Translations</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">User Interfaces</h1>
<span class="subtitle"></span>
<!-- $$$topics-ui.html-description -->
<div class="descr"> <a name="details"></a>
<p>Qt features multiple technologies for creating user interfaces. While it is possible to mix and match these different technologies as needed, one approach is often better suitable for a certain type of user interface than the others. <a href="http://doc.qt.io/qtcreator/index.html">Qt Creator</a> is a good example of an application that combines traditional Qt Widgets with Qt Quick. Widgets form the basis of the user interface, whereas Qt Quick is used to implement the Welcome mode, for example. The following sections provide brief introductions to the available technologies for creating user interfaces, and a comparison table to help choosing the best suitable technology.</p>
<a name="common-important-ui-topics"></a>
<h3 >Common Important UI Topics</h3>
<ul>
<li><a href="highdpi.html">High DPI Displays</a></li>
</ul>
<a name="qml-graphical-user-interfaces"></a>
<h2 id="qml-graphical-user-interfaces">QML Graphical User Interfaces</h2>
<p>QML allows developers to build user interfaces in a declarative way. User interfaces specifically benefit from the simplicity of compounding QML objects and configuring them using property bindings.</p>
<p>Qt Quick is a module which supplies QML types for creating user interfaces such as a visual canvas with its own coordinate system and rendering engine. Animation and transition effects are a first class concept in Qt Quick and visual effects can be supplemented through specialized components for particle and shader effects.</p>
<a name="important-ui-topics-for-qml-applications"></a>
<h3 >Important UI Topics for QML Applications</h3>
<ul>
<li><a href="qtquick-usecase-visual.html">Visual types in QML</a></li>
<li><a href="qtquick-usecase-userinput.html">Responding to User Input in QML</a></li>
<li><a href="qtquick-usecase-animations.html">Animations in QML</a></li>
<li><a href="qtquick-usecase-text.html">Displaying Text in QML</a></li>
<li><a href="qtquick-usecase-layouts.html">Layouts in QML</a></li>
<li><a href="qtquick-usecase-styling.html">Style and Theme Support</a></li>
<li><a href="qtquick-usecase-integratingjs.html">Integrating JavaScript in QML</a></li>
<li><a href="scalability.html">Scalability</a></li>
</ul>
<a name="graphical-controls"></a>
<h3 >Graphical Controls</h3>
<p>The Qt Quick Controls module (since Qt 5.1) provides a set of UI elements to create user interfaces for desktop and mobile platforms using Qt Quick 2. The Qt Quick Controls 2 module (since Qt 5.7) provides lightweight QML types for creating performant user interfaces for embedded and mobile devices. These controls achieve improved efficiency by employing a simplified styling architecture when compared to the first set of controls. For a comparison of the two sets of controls, see Differences between Qt Quick Controls.</p>
<p>For more about how to create application user interfaces with QML, visit the <a href="qmlapplications.html#qml-user-interfaces">QML User Interfaces</a> page.</p>
<a name="widget-based-user-interfaces"></a>
<h2 id="widget-based-user-interfaces">Widget-based User Interfaces</h2>
<p>Qt Widgets are traditional user interface elements that are typically found in desktop environments. The widgets integrate well to the underlying platform providing native look'n'feel on Windows, Linux and Mac OSX. The widgets are mature and feature rich user interface elements suitable for mostly static user interfaces. In contrast to Qt Quick, the widgets do not scale that well for touch screens and fluid, highly animated modern user interfaces. The widgets are a good choice for applications with traditional desktop centric user interfaces, such as office type applications.</p>
<a name="important-concepts-in-qt-widgets"></a>
<h3 >Important Concepts in Qt Widgets</h3>
<ul>
<li>Application Main Window</li>
<li><a href="desktop-integration.html">Desktop Integration</a></li>
<li>Dialog Windows</li>
<li>Layout Management</li>
<li>Model/View Programming</li>
<li>Rich Text Processing</li>
<li>Drag and Drop</li>
<li><a href="internationalization.html">Internationalization</a></li>
</ul>
<a name="visualizing-data"></a>
<h2 id="visualizing-data">Visualizing Data</h2>
<p>Qt provides ready-made C++ classes and QML types for visualizing data in the form of charts and graphs, which are known to be best ways of analyzing data. Qt Charts and Qt Data Visualization are the two Qt add-ons that make data visualization using 2D and 3D models a reality.</p>
<a name="displaying-web-content"></a>
<h2 id="displaying-web-content">Displaying Web Content</h2>
<p>Qt provides the Chromium-based WebEngine layout engine, which enables you to embed web content into the Qt application. The engine can be integrated into both Qt Widget-based and Qt Quick-based applications.</p>
<p>For more information about support for web content in Qt, see <a href="topics-web-content.html">Integrating Web Content</a>.</p>
<a name="comparison"></a>
<h2 id="comparison">Comparison</h2>
<p>Choosing the appropriate technology for building a user interface is not always easy. It depends on several variables, such as other technologies used in a project or target platform constraints. To some extent, many items in the following table can be implemented using any of the three available technologies. The following table aims to help you choose the tool best suited for the job.</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th ></th><th >Qt Quick / Qt Quick Controls</th><th >Qt Widgets</th><th >Qt WebEngine</th><th >Comments</th></tr></thead>
<tr valign="top" class="odd"><td >Used language(s)</td><td >QML/JS</td><td >C++</td><td >HTML/CSS/JS</td><td ></td></tr>
<tr valign="top" class="even"><td >Native look'n'feel</td><td ><img src="images/ok.png" alt="" /></td><td ><img src="images/ok.png" alt="" /></td><td ></td><td >Qt Widgets and Qt Quick Controls integrate well to the underlying platform, providing a native look'n'feel on Windows, Linux, and macOS.</td></tr>
<tr valign="top" class="odd"><td >Custom look'n'feel</td><td ><img src="images/ok.png" alt="" /></td><td ><img src="images/ok.png" alt="" /></td><td ><img src="images/ok.png" alt="" /></td><td >Qt Widgets provide means for customization via style sheets, but Qt Quick is a better performing choice for user interfaces that do not aim to look native.</td></tr>
<tr valign="top" class="even"><td >Fluid animated UIs</td><td ><img src="images/ok.png" alt="" /></td><td ></td><td ><img src="images/ok.png" alt="" /></td><td >Qt Widgets do not scale well for animations. Qt Quick offers a convenient and natural way to implement animations in a declarative manner.</td></tr>
<tr valign="top" class="odd"><td >Touch screen</td><td ><img src="images/ok.png" alt="" /></td><td ></td><td ><img src="images/ok.png" alt="" /></td><td >Qt Widgets often require a mouse cursor for good interaction, whereas Qt Quick only provides primitive building blocks that were designed with touch interaction in mind. The WebView Qt Quick component has support for multi-touch gestures to interact with web content.</td></tr>
<tr valign="top" class="even"><td >Standard industry widgets</td><td ></td><td ><img src="images/ok.png" alt="" /></td><td ></td><td >Qt Widgets provide all the bells and whistles, developed over two decades, needed for building standard industry type applications. Qt WebEngine Widgets provide widgets and additional classes to render and interact with web content.</td></tr>
<tr valign="top" class="odd"><td >Model/View programming</td><td ><img src="images/ok.png" alt="" /></td><td ><img src="images/ok.png" alt="" /></td><td ></td><td >Qt Quick provides convenient views, but Qt Widgets provide more convenient and complete framework. In addition to Qt Quick views, Qt Quick Controls provide a TableView.</td></tr>
<tr valign="top" class="even"><td >Rapid UI development</td><td ><img src="images/ok.png" alt="" /></td><td ><img src="images/ok.png" alt="" /></td><td ><img src="images/ok.png" alt="" /></td><td >Qt Quick is an excellent choice for rapid UI prototyping and development.</td></tr>
<tr valign="top" class="odd"><td >HW accelerated graphics</td><td ><img src="images/ok.png" alt="" /></td><td ><img src="images/ok.png" alt="" /></td><td ><img src="images/ok.png" alt="" /></td><td >Qt Widgets provide QGLWidget for rendering OpenGL graphics, and Qt WebEngine supports WebGL, but the OpenGL ES 2.0 or OpenGL 2.0 based <a href="topics-graphics.html#qt-quick-scene-graph">Qt Quick Scene Graph</a> has proven to provide the best performance for UIs and for integrating with OpenGL content.</td></tr>
<tr valign="top" class="even"><td >Graphical effects</td><td ><img src="images/ok.png" alt="" /></td><td ></td><td ></td><td >The particle system and shader effects available in Qt Quick are more flexible. Qt Widgets offer very little in this area.</td></tr>
<tr valign="top" class="odd"><td >Rich text processing</td><td ><img src="images/ok.png" alt="" /></td><td ><img src="images/ok.png" alt="" /></td><td ></td><td >Qt Widgets currently provide the most comprehensive base for implementing text editors. Qt's rich text document classes can also be utilized in Qt Quick and Qt Quick Controls' TextArea, but may require some C++ implementation.</td></tr>
<tr valign="top" class="even"><td >Existing web content</td><td ></td><td ></td><td ><img src="images/ok.png" alt="" /></td><td >Both Qt Quick and Qt Widgets provide components for presenting simple rich text, but Qt WebEngine is the best choice for presenting full-blown web content.</td></tr>
</table></div>
<a name="internationalization-and-translations"></a>
<h2 id="internationalization-and-translations">Internationalization and Translations</h2>
<p>Qt provides excellent support for translating applications into local languages. Release managers, translators, and developers can use Qt translation tools to accomplish their tasks.</p>
<ul>
<li><a href="internationalization.html">Internationalization with Qt</a> - instructions and the process of creating localized applications.</li>
<li>Qt Linguist Manual - manual of Qt's translation tool</li>
</ul>
</div>
<!-- @@@topics-ui.html -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2017 The Qt Company Ltd.
   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>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>