- Qt 6.10
- Qt 5 Compatibility APIs: Graphical Effects
- Qt 6.10.0 Reference Documentation

# Qt 5 Compatibility APIs: Graphical Effects

The Qt Graphical Effects module is provided for compatibility with applications written for Qt 5.

The Qt Graphical Effects module provides a set of QML types for adding visually impressive and configurable effects to user interfaces. Effects are visual items that can be added to Qt Quick user interface as UI components.

Note: Since the Qt Graphical Effects module has performance constraints when effects are stacked, it is primarily included for compatibility with Qt 5 applications. We recommend that new code is written with one of the new solutions for effects that were introduced in Qt 6. For typical UI effects, Qt Quick has the MultiEffect, which applies multiple effects in one pass. For advanced use cases which are not covered by this component, the Qt Quick Effect Maker tool can be used to customize and fine-tune exactly the shader effects you need.

## Using Qt Graphical Effects

To import the Qt Graphical Effects types, include the Qt Graphical Effects module by adding the following statement to the QML file:

     import Qt5Compat.GraphicalEffects

To use the effects, simply add a specific effect declaration to the QML scene and configure the effects properties. Effects have one or more source properties for specifying the visual input for which the effect is applied to. The altered visual output is then presented in the effect item itself. The source item type can be any QML type, even video or another effect. Pipelining multiple effects together is a simple way to create even more impressive output.

The following list presents the functional division of types that are part of Qt Graphical Effects.

Note: Effects are not available when running with the `software` backend of Qt Quick. For more information on Qt Quick scene graph backends, see Scene Graph Adaptations.

Note: Runtime-generated effects such as GaussianBlur will store the shader-files in temporary storage using QTemporaryFile, thus they require a writable file system.

## Blend

Blend | Merges two source items by using a blend mode

## Color

BrightnessContrast | Adjusts brightness and contrast
ColorOverlay | Alters the colors of the source item by applying an overlay color
Colorize | Sets the color in the HSL color space
Desaturate | Reduces the saturation of the colors
GammaAdjust | Alters the luminance of the source item
HueSaturation | Alters the source item colors in the HSL color space
LevelAdjust | Adjusts color levels in the RGBA color space

## Gradient

ConicalGradient | Draws a conical gradient
LinearGradient | Draws a linear gradient
RadialGradient | Draws a radial gradient

## Distortion

Displace | Moves the pixels of the source item according to the given displacement map

## Drop Shadow

DropShadow | Generates a soft shadow behind the source item
InnerShadow | Generates a colorized and blurred shadow inside the source

## Blur

FastBlur | Applies a fast blur effect to one or more source items
GaussianBlur | Applies a higher quality blur effect
MaskedBlur | Applies a blur effect with a varying intesity
RecursiveBlur | Blurs repeatedly, providing a strong blur effect

## Motion Blur

DirectionalBlur | Applies blur effect to the specified direction
RadialBlur | Applies directional blur in a circular direction around the items center point
ZoomBlur | Applies directional blur effect towards source items center point

## Glow

Glow | Generates a blurred and colorized image of the source and places it behind the original, giving impression that the source is glowing
RectangularGlow | Generates a blurred and colorized rectangle, which gives the impression that the source is glowing

## Mask

OpacityMask | Masks the source item with another item
ThresholdMask | Masks the source item with another item and applies a threshold value