QGIS icon indicating copy to clipboard operation
QGIS copied to clipboard

Build binding with PyQt6

Open troopa81 opened this issue 3 years ago • 5 comments

This PR is a first work to build the binding with PyQt6. So far, approximatively half of the python tests are successfull.

I choose not to update the sip files in order to bring as less as possible modifications to the actual PyQt5 binding, and so lower the chance of regression. As a consequence sipify_all is called before building.

Enum issue

  • When using Enum/Flag in PyQt6, you have to specify scope, I generated mock for QGIS enum so QGIS tests could work but all Qt enum would need to be rewritten... That's an issue that we wouldn't have if we choose to switch from PyQt to PySide ( see Namespaces & Enum)

  • I mocked the Qt enums here so the tests could work

  • flags needs to be generated with the SIP instruction /BaseType=IntFlag/, if not there are considered as plain enum and some operator are missing ('&' operator for instance)

  • Problem is that int flag make them unsigned int and so enum with negative values (QgsProcessing::SourceType for instance) get overflow value

  • Even with int flag there is no implicit conversion from int to enum like it is expected in some test ( here for instance )

To be done

  • Fix all the todo in conversions.sip
  • replace QTextCodec with QStringConverter in QgsVectorDataProvider and QgsJsonUtils
  • Fix all tests
  • Fix all TODO Make it work with Qt6 ( disabled with % If( !PYQT6 ) )

troopa81 avatar Apr 17 '23 16:04 troopa81

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar May 03 '23 02:05 github-actions[bot]

@troopa81 can you pull some more of the self-contained bits out of this? eg https://github.com/qgis/QGIS/pull/52739/commits/9a6146254031218d7e9ee1c6366d59891da012e9 and https://github.com/qgis/QGIS/pull/52739/commits/3609c25c6d8a866782cbbd66601661f6a1e4f8c3 could be merged easily and would help reduce the size and complexity of this pr

nyalldawson avatar May 03 '23 23:05 nyalldawson

@troopa81 can you pull some more of the self-contained bits out of this? eg https://github.com/qgis/QGIS/commit/9a6146254031218d7e9ee1c6366d59891da012e9 and https://github.com/qgis/QGIS/commit/3609c25c6d8a866782cbbd66601661f6a1e4f8c3 could be merged easily and would help reduce the size and complexity of this pr

Done in #53010 and #53009

troopa81 avatar May 04 '23 14:05 troopa81

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar Jun 08 '23 02:06 github-actions[bot]

I blocked all the failing tests.

@nyalldawson Do we agree on the general approach of this PR?

I would like to have it merged so I can move on in fixing tests in separate PRs.

@elpaso @3nids @m-kuhn Any thoughts about this?

troopa81 avatar Jun 28 '23 06:06 troopa81

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar Jul 13 '23 02:07 github-actions[bot]

Sorry for the super short review @troopa81 it's a quite large PR and I currently lack the time for an in-depth review. Potentially someone from the people who are working on behalf of the PSC on the Qt6 migration could have a look at this?

m-kuhn avatar Jul 13 '23 13:07 m-kuhn

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar Jul 28 '23 02:07 github-actions[bot]

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar Aug 12 '23 02:08 github-actions[bot]

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar Aug 31 '23 02:08 github-actions[bot]

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request. If there is no further activity on this pull request, it will be closed in a week.

github-actions[bot] avatar Sep 19 '23 02:09 github-actions[bot]

While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist.

github-actions[bot] avatar Sep 26 '23 02:09 github-actions[bot]