Skip to content

Clarify supported Qt bindings #483

@cdelston0

Description

@cdelston0

At present, there is no documentation for which Qt bindings NodeGraphQt requires/supports. As a new developer, it would be really useful to know which bindings are being targetted by the package. Whilst supporting as many versions of Qt as possible would be a noble goal, it's an impossibly large testing surface to support.

I've done some experimentation here to try and determine which Qt versions are supported by installing the various options in a virtual environment and then running the basic_example.py to see if it starts at all.

I've found that that following options work:

PyQt5
PySide2
PySide6

PyQt6 gives the following traceback:

(nodes) chris@laptop:~/Projects/nodes$ PYTHONPATH=./NodeGraphQt/ python3 NodeGraphQt/examples/basic_example.py
Traceback (most recent call last):
File "/home/chris/Projects/nodes/NodeGraphQt/examples/basic_example.py", line 9, in
from examples.nodes import basic_nodes, custom_ports_node, group_node, widget_nodes
File "/home/chris/Projects/nodes/NodeGraphQt/examples/nodes/basic_nodes.py", line 3, in
from NodeGraphQt import BaseNode, BaseNodeCircle, BaseNodeSVG
File "/home/chris/Projects/nodes/NodeGraphQt/NodeGraphQt/init.py", line 50, in
from .base.graph import NodeGraph, SubGraph
File "/home/chris/Projects/nodes/NodeGraphQt/NodeGraphQt/base/graph.py", line 11, in
from NodeGraphQt.base.commands import (NodeAddedCmd, NodeMovedCmd,
File "/home/chris/Projects/nodes/NodeGraphQt/NodeGraphQt/base/commands.py", line 4, in
from NodeGraphQt.constants import PortTypeEnum
File "/home/chris/Projects/nodes/NodeGraphQt/NodeGraphQt/constants.py", line 38, in
ITEM_CACHE_MODE = QtWidgets.QGraphicsItem.DeviceCoordinateCache
AttributeError: type object 'QGraphicsItem' has no attribute 'DeviceCoordinateCache'

My humble suggestion would be that anyone picking this up for a new development is probably going to be starting with Qt6, so I think it makes sense to have a requirement on either PySide6 or PyQt6 (which will require fixing the above traceback...).

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions