Skip to content

About Qt6 #13

Closed
Closed

Description

@BlueGhostStudio

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

thanks.

Activity

  1. florianlink commented on Jun 18, 2020

    @florianlink
    Collaborator
  2. BlueGhostStudio commented on Jun 18, 2020

    @BlueGhostStudio
    Author

    Thanks for your respond

  3. jamesobutler commented on Aug 31, 2020

    @jamesobutler
    Contributor

    @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.

  4. Murmele commented on Nov 2, 2020

    @Murmele

    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.

  5. Murmele commented on Nov 6, 2020

    @Murmele

    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?

  6. florianlink commented on Nov 6, 2020

    @florianlink
    Collaborator
  7. davidkhess commented on Dec 30, 2020

    @davidkhess

    @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*
    
  8. davidkhess commented on Dec 30, 2020

    @davidkhess

    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

  9. florianlink commented on Jan 2, 2021

    @florianlink
    Collaborator
  10. jamesobutler commented on Jan 2, 2022

    @jamesobutler
    Contributor

    @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?

  11. florianlink commented on Jan 2, 2022

    @florianlink
    Collaborator
  12. pieper commented on May 23, 2022

    @pieper
    Contributor

    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

  13. lassoan commented on Nov 8, 2022

    @lassoan
    Contributor

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

  14. Lbardoux commented on Jan 23, 2023

    @Lbardoux

    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

  15. 10 remaining items

  16. richard42 commented on Aug 22, 2023

    @richard42
    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.

  17. mrbean-bremen commented on Aug 22, 2023

    @mrbean-bremen
    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...

  18. richard42 commented on Aug 23, 2023

    @richard42
    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)

  19. mrbean-bremen commented on Aug 23, 2023

    @mrbean-bremen
    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.

  20. richard42 commented on Aug 30, 2023

    @richard42
    Contributor

    Okay, the new pull request is here:
    #109

  21. gtkramer commented on Sep 19, 2023

    @gtkramer

    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.

  22. mrbean-bremen commented on Oct 9, 2023

    @mrbean-bremen
    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.

  23. jamesobutler commented on Nov 10, 2023

    @jamesobutler
    Contributor

    @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?

  24. mrbean-bremen commented on Nov 10, 2023

    @mrbean-bremen
    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).

  25. mrbean-bremen commented on Dec 15, 2023

    @mrbean-bremen
    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...

  26. ArmandRathgeb commented on Jan 3, 2024

    @ArmandRathgeb

    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.

  27. mrbean-bremen commented on Jan 3, 2024

    @mrbean-bremen
    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.

  28. ArmandRathgeb commented on Jan 3, 2024

    @ArmandRathgeb

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

  29. mrbean-bremen commented on Feb 5, 2024

    @mrbean-bremen
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions