Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Shayen opened this issue Jan 8, 2019 · 4 comments
Closed

Comments

@Shayen
Copy link

Shayen commented Jan 8, 2019

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
Copy link
Owner

jchanvfx commented Jan 8, 2019

hi @Shayen

Here's a thread from another project that might explain.
mottosso/Qt.py#302

@Shayen
Copy link
Author

Shayen commented Jan 9, 2019

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
Copy link
Owner

jchanvfx commented Jan 9, 2019

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
Copy link
Author

Shayen commented Jan 9, 2019

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

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

No branches or pull requests

2 participants