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

About Qt6 #13

Closed
BlueGhostStudio opened this issue Jun 18, 2020 · 38 comments
Closed

About Qt6 #13

BlueGhostStudio opened this issue Jun 18, 2020 · 38 comments
Labels

Comments

@BlueGhostStudio
Copy link

Qt6 is coming. Are there any plans to update PythonQt to support qt6?

thanks.

@florianlink
Copy link
Collaborator

florianlink commented Jun 18, 2020 via email

@BlueGhostStudio
Copy link
Author

Thanks for your respond

@jamesobutler
Copy link

@florianlink 🙏 Thank you for supporting this project. Would you be willing to check-in generated wrappers for Qt 5.15? It is the last minor version of Qt 5 before Qt 6. This would be helpful as a final point before going to Qt 6 for this project.

@Murmele
Copy link

Murmele commented Nov 2, 2020

Thank you @florianlink for that answer. I'm thinking about using pythonqt for another project, but was not shure about the wrapper generator because the last official commit at qt side was 3 years ago.

@Murmele
Copy link

Murmele commented Nov 6, 2020

I'm interested in helping port to PySide for Qt6. @florianlink Do there exist a communication channel if I have some questions regarding the code?

@florianlink
Copy link
Collaborator

florianlink commented Nov 6, 2020 via email

@davidkhess
Copy link

davidkhess commented Dec 30, 2020

@florianlink is there any word on Qt 5.15 generated wrappers being added? I'm not quite sure how to invoke python_generator but I think I'm doing it right with:

>set QTDIR=C:\Qt\5.15.2\msvc2019_64
>pythonqt_generator.exe

It throws a lot of warnings and then a lot of classes are missing in the result.

For instance, QtGui builtin is missing QFont, QMatrix, QPen, and more.

I'm not sure if there is something wrong with my environment or if the typesystem_*.xml files need updating. I've turned up the debugging but it doesn't provide any clues.

Is there any advice you can provide on how to fix this?

Here's some output:

Please wait while source files are being generated...
Parsing typesystem file [:/trolltech/generator/build_all.txt]
 - DEBUG() :: Parsed: 'typesystem_core.xml', 461 new entries
 - DEBUG() :: Parsed: 'typesystem_gui.xml', 911 new entries
 - DEBUG() :: Parsed: 'typesystem_sql.xml', 32 new entries
 - DEBUG() :: Parsed: 'typesystem_opengl.xml', 28 new entries
 - DEBUG() :: Parsed: 'typesystem_svg.xml', 7 new entries
 - DEBUG() :: Parsed: 'typesystem_network.xml', 123 new entries
 - DEBUG() :: Parsed: 'typesystem_xml.xml', 45 new entries
 - DEBUG() :: Parsed: 'typesystem_webkit.xml', 52 new entries
 - DEBUG() :: Parsed: 'typesystem_webenginewidgets.xml', 39 new entries
 - DEBUG() :: Parsed: 'typesystem_xmlpatterns.xml', 26 new entries
 - DEBUG() :: Parsed: 'typesystem_uitools.xml', 2 new entries
WARNING() :: Duplicate type entry: 'QMultimedia'
 - DEBUG() :: Parsed: 'typesystem_multimedia.xml', 170 new entries
 - DEBUG() :: Parsed: 'typesystem_qml.xml', 38 new entries
 - DEBUG() :: Parsed: 'typesystem_quick.xml', 74 new entries
 - DEBUG() :: Parsed: ':/trolltech/generator/build_all.txt', 2009 new entries
PreProcessing - Generate [.preprocessed.tmp] using [:/trolltech/generator/qtscript_masterinclude.h] and include-paths []
-------------------------------------------------------------
Using QT at: C:\Qt\5.15.2\msvc2019_64
-------------------------------------------------------------
Building model using [.preprocessed.tmp]
In file C:\Qt\5.15.2\msvc2019_64\include\QtCore\qglobal.h:
** SHIT QDataStream
        definition *ignored*
** SHIT QDataStream
        definition *ignored*
** SHIT QDataStream
        definition *ignored*
** SHIT name
        definition *ignored*
** WARNING scope not found for symbol:Ops::loadRelaxed
** WARNING scope not found for symbol:Ops::storeRelaxed
** WARNING scope not found for symbol:Ops::loadAcquire
** WARNING scope not found for symbol:Ops::storeRelease
** WARNING scope not found for symbol:Ops::isReferenceCountingNative
** WARNING scope not found for symbol:Ops::isReferenceCountingWaitFree
** WARNING scope not found for symbol:Ops::ref
** WARNING scope not found for symbol:Ops::deref
** WARNING scope not found for symbol:Ops::isTestAndSetNative
** WARNING scope not found for symbol:Ops::isTestAndSetWaitFree
** WARNING scope not found for symbol:Ops::testAndSetRelaxed
** WARNING scope not found for symbol:Ops::testAndSetAcquire
** WARNING scope not found for symbol:Ops::testAndSetRelease
** WARNING scope not found for symbol:Ops::testAndSetOrdered
** WARNING scope not found for symbol:Ops::testAndSetRelaxed
** WARNING scope not found for symbol:Ops::testAndSetAcquire
** WARNING scope not found for symbol:Ops::testAndSetRelease
** WARNING scope not found for symbol:Ops::testAndSetOrdered
** WARNING scope not found for symbol:Ops::isFetchAndStoreNative
** WARNING scope not found for symbol:Ops::isFetchAndStoreWaitFree
** WARNING scope not found for symbol:Ops::fetchAndStoreRelaxed
** WARNING scope not found for symbol:Ops::fetchAndStoreAcquire
** WARNING scope not found for symbol:Ops::fetchAndStoreRelease
** WARNING scope not found for symbol:Ops::fetchAndStoreOrdered
** WARNING scope not found for symbol:Ops::isFetchAndAddNative
** WARNING scope not found for symbol:Ops::isFetchAndAddWaitFree
** WARNING scope not found for symbol:Ops::fetchAndAddRelaxed
** WARNING scope not found for symbol:Ops::fetchAndAddAcquire
** WARNING scope not found for symbol:Ops::fetchAndAddRelease
** WARNING scope not found for symbol:Ops::fetchAndAddOrdered
** WARNING scope not found for symbol:Ops::fetchAndSubRelaxed
** WARNING scope not found for symbol:Ops::fetchAndSubAcquire
** WARNING scope not found for symbol:Ops::fetchAndSubRelease
** WARNING scope not found for symbol:Ops::fetchAndSubOrdered
** WARNING scope not found for symbol:Ops::fetchAndAndRelaxed
** WARNING scope not found for symbol:Ops::fetchAndAndAcquire
** WARNING scope not found for symbol:Ops::fetchAndAndRelease
** WARNING scope not found for symbol:Ops::fetchAndAndOrdered
** WARNING scope not found for symbol:Ops::fetchAndOrRelaxed
** WARNING scope not found for symbol:Ops::fetchAndOrAcquire
** WARNING scope not found for symbol:Ops::fetchAndOrRelease
** WARNING scope not found for symbol:Ops::fetchAndOrOrdered
** WARNING scope not found for symbol:Ops::fetchAndXorRelaxed
** WARNING scope not found for symbol:Ops::fetchAndXorAcquire
** WARNING scope not found for symbol:Ops::fetchAndXorRelease
** WARNING scope not found for symbol:Ops::fetchAndXorOrdered
** WARNING scope not found for symbol:Ops::loadRelaxed
** WARNING scope not found for symbol:Ops::storeRelaxed
** WARNING scope not found for symbol:Ops::loadAcquire
** WARNING scope not found for symbol:Ops::storeRelease
** WARNING scope not found for symbol:Ops::isTestAndSetNative
** WARNING scope not found for symbol:Ops::isTestAndSetWaitFree
** WARNING scope not found for symbol:Ops::testAndSetRelaxed
** WARNING scope not found for symbol:Ops::testAndSetAcquire
** WARNING scope not found for symbol:Ops::testAndSetRelease
** WARNING scope not found for symbol:Ops::testAndSetOrdered
** WARNING scope not found for symbol:Ops::testAndSetRelaxed
** WARNING scope not found for symbol:Ops::testAndSetAcquire
** WARNING scope not found for symbol:Ops::testAndSetRelease
** WARNING scope not found for symbol:Ops::testAndSetOrdered
** WARNING scope not found for symbol:Ops::isFetchAndStoreNative
** WARNING scope not found for symbol:Ops::isFetchAndStoreWaitFree
** WARNING scope not found for symbol:Ops::fetchAndStoreRelaxed
** WARNING scope not found for symbol:Ops::fetchAndStoreAcquire
** WARNING scope not found for symbol:Ops::fetchAndStoreRelease
** WARNING scope not found for symbol:Ops::fetchAndStoreOrdered
** WARNING scope not found for symbol:Ops::isFetchAndAddNative
** WARNING scope not found for symbol:Ops::isFetchAndAddWaitFree
** WARNING scope not found for symbol:Ops::fetchAndAddRelaxed
** WARNING scope not found for symbol:Ops::fetchAndAddAcquire
** WARNING scope not found for symbol:Ops::fetchAndAddRelease
** WARNING scope not found for symbol:Ops::fetchAndAddOrdered
** WARNING scope not found for symbol:Ops::fetchAndSubRelaxed
** WARNING scope not found for symbol:Ops::fetchAndSubAcquire
** WARNING scope not found for symbol:Ops::fetchAndSubRelease
** WARNING scope not found for symbol:Ops::fetchAndSubOrdered
In file C:\Qt\5.15.2\msvc2019_64\include\QtCore\qatomic.h:
** SHIT QAtomicInt
        definition *ignored*
In file C:\Qt\5.15.2\msvc2019_64\include\QtCore\qglobal.h:
** SHIT toLatin1
        definition *ignored*
** SHIT toLatin1
        definition *ignored*
** SHIT toLatin1
        definition *ignored*
** SHIT toLatin1
        definition *ignored*
** SHIT toLatin1
        definition *ignored*
** SHIT toLatin1
        definition *ignored*
** SHIT toLatin1
        definition *ignored*
** SHIT toLatin1
        definition *ignored*
** SHIT toLatin1
        definition *ignored*
** SHIT toLatin1
        definition *ignored*
** SHIT toLatin1
        definition *ignored*
** WARNING scope not found for symbol:QChar::category
** WARNING scope not found for symbol:QChar::direction
** WARNING scope not found for symbol:QChar::joiningType
** WARNING scope not found for symbol:QChar::combiningClass
** WARNING scope not found for symbol:QChar::hasMirrored
** WARNING scope not found for symbol:QChar::decompositionTag
** WARNING scope not found for symbol:QChar::digitValue
** WARNING scope not found for symbol:QChar::script
** WARNING scope not found for symbol:QChar::unicodeVersion
** WARNING scope not found for symbol:QChar::isPrint
** WARNING scope not found for symbol:QChar::isSpace
** WARNING scope not found for symbol:QChar::isMark
** WARNING scope not found for symbol:QChar::isPunct
** WARNING scope not found for symbol:QChar::isSymbol
** WARNING scope not found for symbol:QChar::isLetter
** WARNING scope not found for symbol:QChar::isNumber
** WARNING scope not found for symbol:QChar::isLetterOrNumber
** WARNING scope not found for symbol:QChar::isDigit
** WARNING scope not found for symbol:QChar::isLower
** WARNING scope not found for symbol:QChar::isUpper
** WARNING scope not found for symbol:QChar::isTitleCase
** WARNING scope not found for symbol:QChar::isNonCharacter
** WARNING scope not found for symbol:QChar::isHighSurrogate
** WARNING scope not found for symbol:QChar::isLowSurrogate
** WARNING scope not found for symbol:QChar::isSurrogate
** SHIT QIncompatibleFlag
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::~QByteArray
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::size
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::at
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::operator[]
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::operator[]
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::isEmpty
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::operator const char *
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::operator const void *
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::data
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::data
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::constData
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::detach
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::isDetached
        definition *ignored*
** SHIT QByteArray::isDetached
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::capacity
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::reserve
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::squeeze
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::operator[]
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::operator[]
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::front
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::back
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::begin
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::begin
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::cbegin
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::constBegin
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::end
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::end
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::cend
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::constEnd
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::append
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::prepend
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::operator+=
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::operator+=
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::operator+=
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::push_back
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::push_back
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::push_back
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::push_front
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::push_front
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::push_front
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::contains
        definition *ignored*
** WARNING scope not found for function definition: QByteArray::contains
        definition *ignored*

@davidkhess
Copy link

davidkhess commented Dec 30, 2020

I should add, I'm able to successfully build and use the 5.11 generated wrapper with 5.15.2. I just need to access a new method on QJSEngine that was added in 5.12.

cc: @usiems

@florianlink
Copy link
Collaborator

florianlink commented Jan 2, 2021 via email

@jamesobutler
Copy link

@florianlink Having been 1 year since the last comment on this thread, is PythonQt still an active project with plans for Qt6 support? Or are developers encouraged to use Pyside6 instead?

@florianlink
Copy link
Collaborator

florianlink commented Jan 2, 2022 via email

@pieper
Copy link

pieper commented May 23, 2022

I haven't looked into this for a very long time either, but this code indicates that pyside should now be usable from inside a C++ application.

https://github.com/pyside/pyside-setup/tree/dev/examples/scriptableapplication

@lassoan
Copy link
Contributor

lassoan commented Nov 8, 2022

@florianlink Thank you for all your work in this project. Do you have more information about when Qt6 support may become available?

@Lbardoux
Copy link

Hello @florianlink, in my company we will need PythonQt to build with Qt6.2 very soon. Therefore we thought to participate to this awesome project.
The idea is to take one of the generated_cpp folder (coming from the latest qt5 version possible) and to modify the code to make it compatible with Qt6.2.
What do you think of this approach?

If the approach end up being an "OK idea", I might have few questions later on (especially about PythonQtShell_ classes).

Best regards,
Laurent Bardoux

@lassoan
Copy link
Contributor

lassoan commented Feb 6, 2023

@florianlink Do you have any update on this? Are you expecting external support (funding or contributions with implementation, testing, etc.) to make PythonQt work with Qt6?

@lassoan
Copy link
Contributor

lassoan commented Jul 24, 2023

@florianlink I'm trying to remain hopeful, due to the lack of updates and any specific information for over 3 years, I'm beginning to worry. Qt5 open-source support has ended long time ago and even LTS commercial support will end within 2 years (https://www.qt.io/blog/qt-5.15-extended-support-for-subscription-license-holders). So, while there are no serious problems right now, the risk of thing starting to break is increasing and we definitely need a solution within 2 years.

We haven't heard from you for on this thread for 1.5 years - are you still around? It would be useful even if you could just confirm that updating of PythonQt for Qt6 is still the plan (that MeVisLab doesn't plan to switch to Python for Qt), but if you could share some more details then it would be even better. Thank you!

@mrbean-bremen
Copy link
Contributor

Not being @florianlink, I can nonetheless state that the plan to add Qt6 support to PythonQt has not changed. As for the time line - this should be done in a few months, latest at the end of the year.
This will probably be done on a separate branch that will not be upward compatible to Qt5, though that has not been decided yet and is open for discussion.

@he-hesce
Copy link
Contributor

he-hesce commented Jul 25, 2023

Just of note (you know me by now) is that Qt 5.15 ships with RHEL 9 so it will have commercial support by RedHat until at least 2032. So there are probably more people like me in production environments who wish that PythonQt keeps supporting Qt 5 for quite a while. RHEL 10 may ship with Qt 6 but RHEL 10 is still many years off and RHEL 7/8/9 will remain in use. So nothing against adding Qt 6 support but just as Python devs officially dropped support for Python 2.7 years ago doesn't mean it goes away. RHEL 7 still ships with Python 2.7 and is under active commercial support. Qt 5.15 will be in use and commercially supported by third parties for years beyond whenever Qt company drops support.

Also, if there isn't already, Qt 5 will likely be forked and developed separately due to the license change with Qt 6. Qt company dropped QtWebKit after Qt 5.6 but it is still developed and maintained by original developer and still ships with most major Linux distributions up to this day. Qt 5 will live on, likely supported and maintained by some open-source group who does not like the Qt 6 license change.

@lassoan
Copy link
Contributor

lassoan commented Jul 25, 2023

@mrbean-bremen and @he-hesce I really appraciate your quick and insightful answers.

I can nonetheless state that the plan to add Qt6 support to PythonQt has not changed. As for the time line - this should be done in a few months, latest at the end of the year.

@mrbean-bremen This is very reassuring to hear. By the end of the year sounds great.

with RHEL 9 so it will have commercial support by RedHat until at least 2032

Thanks for the information. RHEL is an important platform, so this will be useful, but there are other linux flavors and Windows and macOS that our application should work on, so staying on Qt5 for too long seems like a risky strategy.

Qt 5 will live on, likely supported and maintained by some open-source group who does not like the Qt 6 license change.

Qt 5/6 will likely to diverge over time, so backporting or redoing fixes and improvements from Qt6 could become harder and harder. It would be great if a stable open-source Qt distribution lived on, but might be unsustainable in the long term. They might also not care about Windows and macOS support. We'll have to see.

@mrbean-bremen
Copy link
Contributor

mrbean-bremen commented Jul 25, 2023

@he-hesce - this is not about supporting Qt 5 anymore, just about branching policy. We may have separate branches for Qt5 and 6 (both active), or a single branch as now. Both approaches have pros and cons.
Given that the version for Qt6 will use a new generator based on Shiboken (at least this is the plan) that will not be compatible with Qt5, we need at least 2 different generators. This may still be done on the same branch, but at the moment I think it would be cleaner to make a Qt6-only branch (which will eventually be the main branch), and continue to maintaian Qt5 on a separate branch as needed.

@lassoan
Copy link
Contributor

lassoan commented Jul 25, 2023

just about branching policy

FYI, as user of PythonQt in 3D Slicer, either a single branch or two separate branches are good for us. You can choose whichever is easier for you to develop and maintain,

@he-hesce
Copy link
Contributor

he-hesce commented Jul 25, 2023

@mrbean-bremen : It's up to you as product owner to decide on branching policy. There are as you say pros and cons. A definite con for two branches is that bug fixes needs to be applied in two places and patches to Qt 6 branch for a bug may need to be ported to the other branch if the code is too different. Also a single branch is easier to keep tested with good coverage as you benefit from cross-testing, i.e., people testing with Qt 6 will also test the a lot of the same code used for Qt 5 and hence you get better testing coverage (as in number of eyes/systems).

To me it doesn't matter much as we will be using Qt 5.15 for another 10 years at least. May look at Qt 6 in a decade or so or put some toes into the water with RHEL 10 eventually (if it ships with Qt 6). Building two separate branches for us in the same repo is also not a problem. However, as a software engineer and open-source contributor, I also always like to have a community and long-term view on things and speak up for those who remain silent or are without a voice in this forum :-)

@richard42
Copy link
Contributor

Hello, my employer (FotoKem Inc.) had a need to upgrade this library to build against Qt6 for use in one of our products, and so I did that. Our application runs Python scripts internally, and those scripts use our application's own QObject-derived objects, but don't use any Qt objects. So we do not need the generator, or its generated c++ meta-code, or the libPythonQt_QtAll library. I was able to fix all of the Qt6 compatibility issues in the core PythonQt library without too much trouble, and remove all of the dependencies with the generated code to build a functional libPythonQt-Qt6 library. My employer has decided to contribute these changes back to the community for others to use as well. The Qt6 compatibility changes are in my PythonQt fork here:

https://github.com/richard42/pythonqt

This may also be useful to the upstream MeVisLab team to use as a starting point for the Qt6 branch. To build the library, just clone my fork, run "qmake" with the appropriate options from the root folder, then "make all" from the "src" sub-folder.

@mrbean-bremen
Copy link
Contributor

Thank you - that may indeed help us! Contributing changes back to the community is always a Good Thing ™️, and we appreciate that.
I understand that your changes are compatible both with Qt5 and 6?
We still need the new generator, but it is good to already have working code of the library.

@richard42
Copy link
Contributor

Yes, all of my changes are backwards-compatible to Qt 5.15.2. Some of the changes might not work with older Qt5 versions, for instance I had to switch usages of QDateTime::toTime_t() to toSecsSinceEpoch(), which was introduced in Qt 5.8. But I'm pretty sure that all of these changes will work at a minimum in Qt 5.12, maybe even older.

@mrbean-bremen
Copy link
Contributor

Thanks! Maybe you can just make a PR from your changes - not for immediate merge, but to have a better look at the diff and to see what the CI has to say...

@richard42
Copy link
Contributor

I broke up the changes into 5 separate commits, which can be seen here:

https://github.com/richard42/pythonqt/commits/master

I assume that you only want the middle commit in the PR? (Qt6 compatibility fixes for core PythonQt library)

@mrbean-bremen
Copy link
Contributor

I assume that you only want the middle commit in the PR?

Thanks - yes, that looks right. It will not work with Qt6 of course, but it would still good to have as a PR for better comparison, and to see which of the CI actually breaks with it.

@richard42
Copy link
Contributor

Okay, the new pull request is here:
#109

@gtkramer
Copy link

gtkramer commented Sep 19, 2023

Our application runs Python scripts internally, and those scripts use our application's own QObject-derived objects, but don't use any Qt objects. So we do not need the generator, or its generated c++ meta-code, or the libPythonQt_QtAll library.

From what I can tell, this is our use case too. PythonQt became a convenient way for us to not worry about how Python bindings were made for our Qt C++ code. Since we're just using PythonQt to enable writing Python scripts that pre-configure a user interface when the application opens up, we're evaluating other options that will let us move to new versions of Qt more easily on our own timeline.

So far, we're having good luck with PyBind11. This gives us a way to have compiler-supported bindings without a generator, which reduces overall complexity. While this does lock us into one version of Python, it's not a problem for us. Embedding the Python interpreter into our application to evaluate our Python scripts also isn't hard from there with PyBind11. We can also pre-import the compiled module for these scripts and inject our Qt objects into the global Python namespace dictionary if needed.

We tried going down the Shiboken route, but the complexity there is pretty high and it has a bit of a learning curve. While it supports everything about Qt, we still opted to use PyBind11 even though it doesn't support signals and slots to keep things simple. PyBind11 can still create bindings to slots, which we expose as a part of the Python API for our module from C++.

I would love for something like PythonQt to be officially adopted by the Qt project. It's a shame that it's not since the idea of using Python to automate an interface is pretty awesome.

@mrbean-bremen
Copy link
Contributor

Just for reference: all changes related to Qt6 as provided by @richard42 and @jamesobutler are now on the qt6 branch.

I would love for something like PythonQt to be officially adopted by the Qt project

While this would be nice, it is unlikely given the small user base of PythonQt compared to PyQt & Co.

@jamesobutler
Copy link

@mrbean-bremen I have been unable to find where https://github.com/MeVisLab/pythonqt/tree/qt6 has gone as the link 404s now. Where is the Qt 6 support located?

@mrbean-bremen
Copy link
Contributor

Ah, should have mentioned it here. It has been merged back to the main branch, as it still works for Qt 5, and some of the changes also benefit Qt 5 (especially Qt 5.15).

@mrbean-bremen
Copy link
Contributor

Note that the current master supports Python 5.15 and 6.5 - there will be a release (or probably first a pre-release) soon. As with older versions, not all classes and methods are supported, and for Qt6, most of the Add-On modules are not included. They can be included on demand later.
There are currently no generated files for 5.15 and 6.5 included (will probably be added soon), but you can either generate them yourself, or use the wrappers generated by the CI.

It would be helpful if anyone else could test the current state to find some of the bugs that are without doubt included...

@ArmandRathgeb
Copy link

I generated bindings for Qt 6.6.1.
Everything's working so far except it crashes in Debug mode. It says that I need to create a QApplication before I create a QWidget. Not sure if this is specific to Qt6.

@mrbean-bremen
Copy link
Contributor

I don't think that this is specific to Qt6 - you need an application to create a widget. Did this work with Qt5? And does it work in release mode? If this is a new problem, please write a separate issue with the code that shows the problem.

@ArmandRathgeb
Copy link

Yeah it turns out that I just had my debug and release binaries mismatched. It works fine so far.

@mrbean-bremen
Copy link
Contributor

I'm closing this, as Qt6 is supported now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests