QtGraphicalEffects not available in Qt6 (qml)
-
@Cyrille-de-Brebisson I am not sure but when I updated to that preview (tried even the current one) I can compile my code with them again. Using Linux. Not sure how can I check what modules are currently installed in my distribution.
-
Sorry @Cyrille-de-Brebisson for the misleading information. It's a bit late but here is the right solution for all the people who need to use this module in QT6:
git clone git://code.qt.io/qt/qtgraphicaleffects.git cd qtgraphicaleffects/ git checkout 59ab3e11433a5157aac0f3af7c0d7fe70a373373 cd .. ~/Qt/6.2.1/gcc_64/bin/qmake qtgraphicaleffects make cp qml/QtGraphicalEffects ~/Qt/6.2.1/gcc_64/qml/ -r
So I cloned the module code, got a commit before the complete removal of the source files. Compiled and copied the result to the QT distribution directory.
Then replace all the imports:import QtGraphicalEffects 1.0
with
import Qt5Compat.GraphicalEffects
-
@Hitokage Great, but
import QtGraphicalEffects 1.0
works fine &
Qt5Compat.GraphicalEffects
is not available for me.Note that in
qml/QtGraphicalEffects
directory there is no*.qml
file exist, so for example I couldn't useOpacityMask
in my code. In order to use it or any of the following components in your source code:- BrightnessContrast
- Colorize
- ColorOverlay
- ConicalGradient
- Desaturate
- Displace
- DropShadow
- FastBlur
- FastGlow
- GammaAdjust
- Glow
- HueSaturation
- LevelAdjust
- LinearGradient
- OpacityMask
- RadialGradient
- RectangularGlow
- ThresholdMask
you should also run these command which make
QtGraphicalEffects
ready to use in Qt6:$ find qtgraphicaleffects/src/effects/ -maxdepth 1 -name \*.qml -exec cp {} ~/Qt/<VERSION>/gcc_64/qml/QtGraphicalEffects \; $ cp qtgraphicaleffects/src/effects/private/ ~/Qt/<VERSION>/gcc_64/qml/QtGraphicalEffects -r