5

I am using PySide6 and am trying to use the GraphicalEffects module.

As per documentation here: https://doc.qt.io/qt-6/qtgraphicaleffects5-index.html

I am doing:

import Qt5Compat.QtGraphicalEffects

The error I am getting:

"Qt5Compat.QtGraphicalEffects" is not installed

How do I install this module? I have PySide6.2.2.1 installed on my Linux machine.

Aaron
  • 759
  • 1
  • 7
  • 15
  • The Graphical Effects module is provided for backward compatibility with Qt5. Are you actually porting from Qt5, or are you trying to get a graphics effect (which uses shaders in Qt6)? Also, do you need it for QML or QWidgets? – musicamante Jan 18 '22 at 01:23
  • I am rewriting my project from Qt5 to Qt6. I need it for QML and all I need to implement is LinearGradient and ColorOverlay. – Aaron Jan 18 '22 at 01:28
  • 1
    It seems that you need to install the `qt6-5compat` package. – musicamante Jan 18 '22 at 01:47
  • I can't find that package for Debian, only for Arch linux. – Aaron Jan 18 '22 at 02:43
  • Same type of Issue on [Reddit](https://www.reddit.com/r/QtFramework/comments/pskq58/import_qt5compatgraphicaleffects_qml_module_not/) too – Giorgos Xou May 01 '22 at 19:15
  • opened an issue in qt issue tracker https://bugreports.qt.io/browse/PYSIDE-1957 – ניר Jun 06 '22 at 18:12

2 Answers2

2

Its a known issue when installing from pypi. It will be fixed in pyside 6.4.

You can also build from source and it will be added automatically if you installed it with Qt-online installer.

ניר
  • 1,204
  • 1
  • 8
  • 28
  • 1
    I can't edit and the "known issue" link is broken since it has an empty space in the formatting, so here: [known issue](https://bugreports.qt.io/browse/PYSIDE-1957) – user1018051 Oct 01 '22 at 21:51
  • I have PySide6 (plus Addons and Essentials pkgs) version 6.5.1.1, and still have: module "Qt5Compat.QtGraphicalEffects" is not installed. End up using QtQuick.Shapes.LinearGradient instead. – fferri Jul 21 '23 at 09:03
1

An alternative would be to copy the module from the root directory and include it in the development environment.

Here is a more detailed description: QT6.4 QML PYTHON module "Qt5Compat.GraphicalEffects" is not installed

Works with Pyside6 or PyQt6.

Rafa
  • 31
  • 3