Skip to content

Fixes to basic_example.py#482

Merged
jchanvfx merged 1 commit intojchanvfx:mainfrom
cdelston0:ce_start
Oct 24, 2025
Merged

Fixes to basic_example.py#482
jchanvfx merged 1 commit intojchanvfx:mainfrom
cdelston0:ce_start

Conversation

@cdelston0
Copy link
Copy Markdown

I'm looking to get started using NodeGraphQt for a project, and had a little difficulty getting started running the basic example.

First off, my virtual environment looks like this:

$ pip3 list
Package       Version
------------- ----------
NodeGraphQt   0.6.43
pip           22.0.2
PySide2       5.15.2.1
Qt.py         1.4.8
setuptools    59.6.0
shiboken2     5.15.2.1
types-pyside2 5.15.2.1.7

With the above dependencies, I required the changes in this pull request to get basic_example.py to work correctly.
With your input, I'd love to add a 'getting started' section to the readme.md which calls out the dependencies and guides the developer through setting up a virtual environment.

Thanks

Using pyside2 v5.15.2.1 to run basic_example, I got the following:
AttributeError: 'PySide2.QtWidgets.QApplication' object has no attribute 'exec'. Did you mean: 'exec_'?

Changing the call to exec_ does indeed allow the example to run.

On startup, got the following traceback:

Traceback (most recent call last):
  File "/home/chris/Projects/nodes/NodeGraphQt/NodeGraphQt/base/commands.py", line 60, in redo
    self.set_node_property(self.name, self.new_val)
  File "/home/chris/Projects/nodes/NodeGraphQt/NodeGraphQt/base/commands.py", line 48, in set_node_property
    setattr(view, name, value)
  File "/home/chris/Projects/nodes/NodeGraphQt/NodeGraphQt/qgraphics/node_base.py", line 795, in icon
    pixmap = QtGui.QPixmap(path)
TypeError: 'PySide2.QtGui.QPixmap' called with wrong argument types:
  PySide2.QtGui.QPixmap(PosixPath)
Supported signatures:
  PySide2.QtGui.QPixmap()
  PySide2.QtGui.QPixmap(PySide2.QtCore.QSize)
  PySide2.QtGui.QPixmap(PySide2.QtGui.QPixmap)
  PySide2.QtGui.QPixmap(str, typing.Optional[bytes] = None, PySide2.QtCore.Qt.ImageConversionFlags = PySide2.QtCore.Qt.ImageConversionFlag.AutoColor)
  PySide2.QtGui.QPixmap(PySide2.QtGui.QImage)
  PySide2.QtGui.QPixmap(int, int)
  PySide2.QtGui.QPixmap(typing.Sequence[str])

Casting the type of the path to the icon to a string fixes this.
@jchanvfx jchanvfx merged commit 8906761 into jchanvfx:main Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants