Qt 5 Compatibility APIs: Qt Graphical Effects
The Qt Graphical Effects module is provided for compatibility with applications written for Qt 5. As far as practically feasible, effects have been ported, but some dynamically generated effects are incompatible with the approach to shader effects in Qt 6 and have thus been left out:
-
Blend
-
InnerShadow
-
All blur effects besides
FastBlur
: GaussianBlur, MaskedBlur, RecursiveBlur, DirectionalBlur, RadialBlur, ZoomBlur.
Dependencies on any of these types have to be replaced by a custom shader effect in the application code.
Effects are visual items that can be added to Qt Quick user interface as UI components. 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. 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:
颜色
Gradient
Distortion
Displace
|
Moves the pixels of the source item according to the given displacement map
|
Drop Shadow
DropShadow
|
Generates a colorized and blurred shadow image of the source and places it behind the original, giving the impression that source item is raised from the background
|
Blur
FastBlur
|
Applies a fast blur effect to one or more source items
|
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
|
掩码
OpacityMask
|
Masks the source item with another item
|
ThresholdMask
|
Masks the source item with another item and applies a threshold value
|