-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Build PyQt6 with c++ 17 #55538
Build PyQt6 with c++ 17 #55538
Conversation
Do you know what happens with "throw" in pyqt6? Is it treated like it should be and just a hint to sip now? Previously it was needed to correctly get a proper exception raised instead of a generic one. (Ie QgsCsException vs exception) |
No, the documentation says that xvfb-run python3 ../tests/src/python/test_qgsconnectionregistry.py -k testCreateConnectionBad
======================================================================
ERROR: testCreateConnectionBad (__main__.TestQgsConnectionRegistry.testCreateConnectionBad)
Test creating connection with bad parameters
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/julien/work/QGIS/.worktrees/pyqt6/build-fedora/../tests/src/python/test_qgsconnectionregistry.py", line 65, in testCreateConnectionBad
QgsApplication.connectionRegistry().createConnection('invalid')
_core.QgsException: Invalid connection id There is something else to me modified I think. I propose to move on and fix this later. |
Hmm, two things jump to mind here. Maybe it relates to the ordering of exceptions in the exceptions sip file, and we should move the generic exception to be last there. Possibly sip is just matching the first exception type it encounters. Or, possibly we should remove the inheritance from the child exception classes and ensure they aren't QgsExceptions.... |
@nyalldawson Thanks for the hints. I'll try those when it comes to fix more things. First I would rather move toward a first working version, so do you mind merging this one? |
Looks like my first guess was right, and newer sip gives an explicit warning when a generic exception is handled before more specialised exceptions. See #55481 (comment) I've hopefully addressed this in #55576 . I'd love to hear if this fixes things in PyQt6! |
It does fix the exception issue in PyQt6 👍 I will try to remove the throw directive from the sip files in PyQt6 as there are probably ignored. |
There are many fixes to sip beyond the 6.8.0 tag, and one of them is restoring exception code that was mistakenly not generated in some circumstances. So if you are testing with 6.8.0, things are messy. 6.8.0 should not be used at all. |
On my way to split #52739 in small chunks
The hack is no longer needed in Qt 6, as this last requires c++17