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

Qt6 compatibility upgrade #2373

Merged
merged 86 commits into from
Jul 30, 2022
Merged

Qt6 compatibility upgrade #2373

merged 86 commits into from
Jul 30, 2022

Conversation

gzotti
Copy link
Member

@gzotti gzotti commented Mar 30, 2022

This branch should be used as we adapt to Qt6.

Milestones:

  • CMakeLists.txt should work with Qt5.12 and later. Recommended: Qt5.15.2 and Qt6.2.4 (or later)
  • external modules should be removed where possible, upgraded to current where required, or fixed.
  • esp. qcustomplot does not compile. Get rid of it (use QCharts; AstroCalc with QCharts #2390, Exoplanet plugin with QtChart #2447).
  • Replace QtScript by QJSEngine functions (Switch from QtScript to QJSEngine #2461)
  • Upgrade libindi (or better, remove source duplication) so that it compiles with latest gcc (Cannot be built with most recent compilers #2157)
  • Compile main app (without plugins) with Qt6
  • Restore broken text everywhere
  • Compile all plugins with Qt6
  • Upgrade StelAudioMgr module (compiles, but may need fixes with API change) --> Completion after reactivating Scripting in Qt6!
  • Upgrade StelVideoMgr module (compiles, but may need fixes with API change) --> Completion after reactivating Scripting in Qt6!
  • Restore Scenery3D rendering (OBJ loader broken?)

To build with Qt6, disable SCRIPTING. This is dealt with in another branch (#2461).

I think the best strategy for now is working on master with Qt5.15+, trying to get rid of deprecated stuff hinted at by clazy, use feature branches for larger tasks, and occasionally rebase this branch from master to test.

Update 2022-06-08

The program builds! However, text is garbled.

Update 2022-06-29

Finally! Text is visible again.

It should be possible to keep compilation compatible between Qt5 and Qt6, without any extra branch. Qt6 requires 64bit CPUs and fully working OpenGL graphics, so Qt5 will likely have to stay around for a few more years. I have re-extended compatibility back to Qt5.12 (Ubuntu 20LTS, and even 5.9, for Ubuntu 18LTS).

Description

Fixes # (issue)

Screenshots (if appropriate):

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • This change requires a documentation update

How Has This Been Tested?

Test Configuration
Operating system: Windows 10

  • Graphics Card: Nvidia Geforce 960M
  • Qt5.9.9/MSVC2017 configuration with MSVC2019.
  • Qt5.12.8/MSVC2017 configuration with MSVC2019.
  • Qt5.15.2/MSVC2019 configuration with MSVC2017 and MSVC2019.
  • Qt6.2.4/MSVC2019 configuration with MSVC2019. Qt6 really requires MSVC2019!

Operating system: Ubuntu 22.04

  • Graphics Card: (Intel, whatever built into i3-5010U)
  • Qt5.15.3
  • Qt6.2.4

Checklist:

  • My code follows the code style of this project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (header file)
  • I have updated the respective chapter in the Stellarium User Guide
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@gzotti gzotti self-assigned this Mar 30, 2022
@gzotti gzotti added importance: high Obvious error, very annoying, but no crash qt Issues, related to Qt framework labels Mar 30, 2022
@gzotti gzotti added this to the 1.0 milestone Mar 30, 2022
@github-actions github-actions bot added the has conflicts The pull request has conflicts label May 18, 2022
@github-actions

This comment was marked as resolved.

@github-actions github-actions bot removed the has conflicts The pull request has conflicts label May 18, 2022
@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@github-actions github-actions bot added has conflicts The pull request has conflicts and removed has conflicts The pull request has conflicts labels May 18, 2022
@github-actions

This comment was marked as resolved.

@gzotti
Copy link
Member Author

gzotti commented Jun 8, 2022

Dear all,

I did not play with the version numbers, but this may be Stellarium 1.0 alpha.

2022-06-08T17:10:26
Operating System: Windows 10 Version 2009
Compiled using MSVC++ 16.10, 16.11 (Visual Studio 2019)
Qt runtime version: 6.2.4
Qt compilation version: 6.2.4
Addressing mode: 64-bit
Total physical memory: 32631 MB
Available physical memory: 10046 MB
Physical memory in use: 69%
Processor speed: 2592 MHz
Processor name: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Processor speed: 2592 MHz
Processor name: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Processor speed: 2592 MHz
Processor name: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Processor speed: 2592 MHz
Processor name: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Processor speed: 2592 MHz
Processor name: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Processor speed: 2592 MHz
Processor name: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Processor speed: 2592 MHz
Processor name: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Processor speed: 2592 MHz
Processor name: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
D:\StelDev\GIT\build-stellarium-Desktop_Qt_6_2_4_MSVC2019_64bit-Release\src\stellarium.exe -platform windows:altgr 
 ---------------------------------------------------------------------------
[ This is Stellarium 0.22.1-532a784 [towards-Qt6] - https://stellarium.org/ ]
[ Copyright �� 2000-2022 Stellarium Developers                              ]
 ---------------------------------------------------------------------------

I will push this soon. However, all texts are squashed to the left of each window, so there is still work ahead. Also 2 plugins do not yet compile.
grafik

@github-actions github-actions bot added the has conflicts The pull request has conflicts label Jun 8, 2022
@github-actions

This comment was marked as outdated.

@gzotti

This comment was marked as outdated.

@github-actions github-actions bot removed the has conflicts The pull request has conflicts label Jun 8, 2022
@github-actions

This comment was marked as outdated.

@gzotti gzotti added the help wanted We may not have the hardware or expertise label Jun 9, 2022
@gzotti

This comment was marked as outdated.

@alex-w
Copy link
Member

alex-w commented Jun 9, 2022

I have seriously no idea what's going on with the failing text rendering. @alex-w @xalioth @Atque Any ideas?

On macOS 12.4 with Qt 6.3.0 (official package from Qt.io) the main scene is not render (just a black screen) :(

P.S. I got reports, that Stellarium have just a black screen with official 5.15.2 on macOS, but I see no problem for rendering with Qt 5.15.3 from homebrew.

@gzotti
Copy link
Member Author

gzotti commented Jun 9, 2022

Sad. From what I am reading, Mac is leaving OpenGL, replacing by Metal, and Windows still pushes DirectX. Qt6 lost ANGLE, so only full OpenGL PCs will be able to run the Qt6-based series (or MESA should still be available, but of course less fun), unless some GPU hero does the new Qt6 graphics subsystem glue code. .

I cannot find any reports online about bad font rendering or similar terms. This is maddening.

@github-actions github-actions bot added the has conflicts The pull request has conflicts label Jun 19, 2022
@github-actions

This comment was marked as outdated.

@gzotti

This comment was marked as outdated.

@alex-w

This comment was marked as outdated.

@gzotti

This comment was marked as outdated.

gzotti added 10 commits July 29, 2022 20:34
- add dev comments
- also do some cleanup
- Disabled code for Qt6 builds which is problematic/buggy in Qt6
- Errors will remain in code which is in fact currently unused.
- Cleanup most debug output
@github-actions github-actions bot removed the has conflicts The pull request has conflicts label Jul 29, 2022
@github-actions

This comment was marked as resolved.

@gzotti gzotti marked this pull request as ready for review July 29, 2022 18:35
@github-actions github-actions bot requested a review from alex-w July 29, 2022 18:35
@github-actions
Copy link

github-actions bot commented Jul 29, 2022

Great PR! Please pay attention to the following items before merging:

Files matching guide/**:

  • Did you remember to update screenshots to match new updates?
  • Did you remember to grammar check in changed part of documentation?

This is an automatically generated QA checklist based on modified files

@gzotti
Copy link
Member Author

gzotti commented Jul 29, 2022

The failing unit test around units and intersections of SphericalRegions is really bad, and was not able to fix the methods. However the methods are currently not used, so it need not be solved immediately. I #ifdeffed those functions away, and the program still works. Guillaume confirmed he also does not use them.

One side-development in this branch was the program's OpenGL initialisation. ANGLE is of course no longer available. I am however unsure about the current Mac-related code. Else this can now probably be merged for first tests of 1.0beta.

Speaking about version number, @alex-w do you want to develop the new number scheme still in this branch or after merge?

Copy link
Member

@alex-w alex-w left a comment

Choose a reason for hiding this comment

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

Speaking about version number, @alex-w do you want to develop the new number scheme still in this branch or after merge?

Of course after merge

@gzotti gzotti merged commit 3ef4054 into master Jul 30, 2022
@gzotti gzotti deleted the towards-Qt6 branch July 30, 2022 08:59
@alex-w alex-w modified the milestones: 1.0.0, 0.22.3 Jul 31, 2022
@github-actions
Copy link

github-actions bot commented Aug 2, 2022

Hello @gzotti! Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@alex-w alex-w removed the help wanted We may not have the hardware or expertise label Aug 2, 2022
@alex-w alex-w added state: published The fix has been published for testing in weekly binary package and removed state: fixed labels Sep 10, 2022
@github-actions
Copy link

Hello @gzotti!

Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@alex-w alex-w removed the state: published The fix has been published for testing in weekly binary package label Oct 1, 2022
@github-actions
Copy link

github-actions bot commented Oct 1, 2022

Hello @gzotti!

Please check the latest stable version of Stellarium:
https://github.com/Stellarium/stellarium/releases/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
importance: high Obvious error, very annoying, but no crash qt Issues, related to Qt framework
Development

Successfully merging this pull request may close these issues.

2 participants