Skip to content

improve compatibility for qt 6.#20183

Merged
alalek merged 3 commits intoopencv:3.4from
xhawk18:3.4
Oct 4, 2021
Merged

improve compatibility for qt 6.#20183
alalek merged 3 commits intoopencv:3.4from
xhawk18:3.4

Conversation

@xhawk18
Copy link
Copy Markdown
Contributor

@xhawk18 xhawk18 commented May 30, 2021

Recreate the pull request as vpisarev mentioned here --
#19995 (comment)

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake
force_builders=linux,docs,Custom
build_image:Custom=qt:16.04
buildworker:Custom=linux-1

if(Qt5OpenGL_FOUND)
set(QT_QTOPENGL_FOUND ON)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui Widgets Test Concurrent REQUIRED NO_MODULE)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Widgets Test Concurrent REQUIRED NO_MODULE)
Copy link
Copy Markdown
Member

@alalek alalek May 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cases with:

  • WITH_QT=4
  • WITH_QT=5
  • WITH_QT=6
  • and WITH_QT=ON

should be handled properly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block is not used to handle QT4,
please see "if(NOT WITH_QT EQUAL 4)" and code at line 42 ...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean 3.4 branch + Fedora 33 with Qt4 + Qt5:

  • ✔ WITH_QT=ON => YES (ver 5.15.2)
  • ✔ WITH_QT=4 => YES (ver 4.8.7 EDITION = OpenSource)
  • ✔ WITH_QT=5 => YES (ver 5.15.2)
  • ✖ WITH_QT=6 => YES (ver 5.15.2)

Patch original (May) + Fedora 33 with Qt4 + Qt5:

  • ✔ WITH_QT=ON => YES (ver 5.15.2)
  • ✔ WITH_QT=4 => YES (ver 4.8.7 EDITION = OpenSource)
  • ✔ WITH_QT=5 => YES (ver 5.15.2)
  • ✖ WITH_QT=6 => YES (ver 5.15.2)

Patch updated + Fedora 33 with Qt4 + Qt5:

  • ✔ WITH_QT=ON => YES (ver 5.15.2)
  • ✔ WITH_QT=4 => YES (ver 4.8.7 EDITION = OpenSource)
  • ✔ WITH_QT=5 => YES (ver 5.15.2)
  • ✔ WITH_QT=6 => FAILED

Need someone with Qt6 environment to validate behavior

@asmorkalov asmorkalov self-requested a review August 9, 2021 14:16
Copy link
Copy Markdown
Contributor

@asmorkalov asmorkalov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@bebuch
Copy link
Copy Markdown
Contributor

bebuch commented Sep 27, 2021

Is there any progress?

@alalek alalek merged commit 24f43e7 into opencv:3.4 Oct 4, 2021
@alalek alalek mentioned this pull request Oct 4, 2021
@alalek alalek mentioned this pull request Oct 15, 2021
@anguman
Copy link
Copy Markdown

anguman commented Nov 23, 2021

So, is there any tutorial that explains how to use OpenCV latest version (4.5.4) with OT 6?

@bebuch
Copy link
Copy Markdown
Contributor

bebuch commented Nov 24, 2021

@anguman Have been using it for two weeks. Works exactly like Qt5 as far as I can tell. If Qt6 is found, it will be used.

@whalenpt
Copy link
Copy Markdown
Contributor

My build with QT6 fails for OpenCV (4.5.4) with the setting WITH_OPENGL=ON: the highgui module is using the deprecated class QGLWidget. Someone brought this up in issue ticket #20499, but it doesn't seem resolved.

@alalek
Copy link
Copy Markdown
Member

alalek commented Nov 27, 2021

@whalenpt I closed #20499 as original problem is resolved.

Qt6+OpenCL is a bit different problem.
Feel free to open new issue or prepare PR with fix if you have any.

@whalenpt
Copy link
Copy Markdown
Contributor

whalenpt commented Dec 4, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants