jchanvfx / NodeGraphQt

Node graph framework that can be re-implemented into applications that supports PySide2
http://chantonic.com/NodeGraphQt/
MIT License
1.26k stars 256 forks source link

AttributeError: 'module' object has no attribute 'QStringListModel' #92

Closed Shayen closed 5 years ago

Shayen commented 5 years ago

When I try to run example.py in Autodesk Maya 2017 (And still happen in Maya 2018 also), It throw this error:

Traceback (most recent call last):
  File "D:/WORK/Programming/graphapp/NodeGraphQt/example.py", line 37, in <module>
    graph = NodeGraph()
  File "D:\WORK\Programming\graphapp\NodeGraphQt\NodeGraphQt\base\graph.py", line 42, in __init__
    self._viewer = NodeViewer()
  File "D:\WORK\Programming\graphapp\NodeGraphQt\NodeGraphQt\widgets\viewer.py", line 65, in __init__
    self._search_widget = TabSearchWidget(self)
  File "D:\WORK\Programming\graphapp\NodeGraphQt\NodeGraphQt\widgets\tab_search.py", line 63, in __init__
    self._model = QtCore.QStringListModel(node_names, self)
AttributeError: 'module' object has no attribute 'QStringListModel'

After googling for a while I found the solution from another repo.

In this case I just change self._model = QtCore.QStringListModel(node_names, self) To self._model = QtGui.QStringListModel(node_names, self)

then its work for me.

By the way, When I run example.py with normal python3.7 and pyside2(5.12.0) outside Maya, It's work properly with the original code.

jchanvfx commented 5 years ago

hi @Shayen

Here's a thread from another project that might explain. https://github.com/mottosso/Qt.py/pull/302

Shayen commented 5 years ago

Hi @jchanvfx,

Did you have any plan to support the old version of PySide2? like Maya 2017 and 2018, It's using version 2.0.0~alpha0 and 2.0. But the bug has been fixed on 5.6 and 5.9.

jchanvfx commented 5 years ago

Hi @Shayen

Sadly no sorry I don't plan to do any back porting as I'm only working on this project in the spare time I have.

J

Shayen commented 5 years ago

It's okay. =D I'm very appreciate your work ^^