Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The <code>effect</code> attribute, wich all visual QML items have, accepts all the effects which are subclasses of <code>QGraphicsEffect</code>. Qt 4.8 ships with <code>QGraphicsBlurEffect</code>, <code>QGraphicsColorizeEffect</code>, <code>QGraphicsDropShadowEffect</code>, and <code>QGraphicsOpacityEffect</code>. Originally these there all available in QML by default, but at one time in development (before the first public release of QtQuick) they were excluded for performance reasons. To make them work again, one has to include the following lines of code in the C++ part of his application, for instance in the <code>main</code> function:</p> <pre><code>qmlRegisterType&lt;QGraphicsBlurEffect&gt;("Effects",1,0,"Blur"); qmlRegisterType&lt;QGraphicsColorizeEffect&gt;("Effects",1,0,"Colorize"); qmlRegisterType&lt;QGraphicsDropShadowEffect&gt;("Effects",1,0,"DropShadow"); qmlRegisterType&lt;QGraphicsOpacityEffect&gt;("Effects",1,0,"OpacityEffect"); </code></pre> <p>This make these classes available to QML so one can use them like:</p> <pre><code>import QtQuick 1.1 import Effects 1.0 Item { // [...] effect: Blur { blurRadius: 10.0 } } </code></pre> <p>This works, but in many case the resulting performance is really unacceptable. Then you should try to implement blurring with the help of <a href="http://doc.qt.nokia.com/4.8-snapshot/qml-shadereffectitem.html"><code>ShaderEffectItem</code></a>. That way one can realize graphic effects with GLSL shader programs resulting in GPU rendering which is way faster than the old <code>QGraphicsEffect</code>-based approach. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload