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

Rebase #327 and continue migration to PySide6/PyQt6 using qtpy compat layer #420

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

jack-mil
Copy link
Contributor

@jack-mil jack-mil commented May 15, 2024

I am beginning to work on a Qt6 project that will use this library, so I needed to see how feasible porting to Qt6 would be. Work so far is simply rebasing @jowr's work from PR #327 onto main branch, and cleaning up some code added after that PR.

I have done preliminary testing using the example demo with Python 3.12 and QtPy 2.4.1 with both PySide6 v6.7.2 and PyQt6 v6.7.0. (Pyside v6.7.0 has some open bugs with inheritance that prevent the modules from importing properly) Update: These issues are resolved as of v6.7.2 of PySide6, meaning this branch works on all current versions of Qt bindings for Python

Relates to #231

@laurapons
Copy link

Very interested on getting an update on this :)

@jack-mil
Copy link
Contributor Author

jack-mil commented Jun 6, 2024

I have been using the changes from this fork succesfully for a project with PySide 6.6.3.1 with no issues

@fieschkon
Copy link

@jack-mil trying to get your code working on my end - running into the following error using PySide 6.6.3.1 running the example:

Traceback (most recent call last):
  File "NodeGraphQt\examples\basic_example.py", line 28, in <module>
    graph = NodeGraph()
            ^^^^^^^^^^^
  File "NodeGraphQt\examples\NodeGraphQt\base\graph.py", line 158, in __init__
    kwargs.get('viewer') or NodeViewer(undo_stack=self._undo_stack)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "NodeGraphQt\examples\NodeGraphQt\widgets\viewer.py", line 105, in __init__
    self._cursor_text.setFlag(self._cursor_text.ItemIsSelectable, False)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'PySide6.QtWidgets.QGraphicsTextItem' object has no attribute 'ItemIsSelectable'

I get further attribute errors when commenting out the ItemIsSelectable lines. Were you able to run your modifications with the provided example?

@jack-mil
Copy link
Contributor Author

jack-mil commented Jun 25, 2024

@fieschkon It's possibly an issue with the QtPy or python version you are running? This is working for me with

  • Python 3.12.3
  • PySide6 6.6.3.1 and 6.7.2
  • QtPy 2.4.1

I can also confirm that upgrading to PySide6 6.7.2 seems to have resolved the issue that was preventing 6.7.0 from working. So, the changes on this branch do work for the most recent versions of PySide6 and QtPy as of 6/25/24.

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.

4 participants