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

Qt5 QML #3473

Open
DarthGandalf opened this issue Oct 23, 2023 · 10 comments
Open

Qt5 QML #3473

DarthGandalf opened this issue Oct 23, 2023 · 10 comments
Labels
qt Issues, related to Qt framework
Projects

Comments

@DarthGandalf
Copy link
Contributor

According to #2739 (comment) QML is only supported with Qt6. What specifically stops using QML with Qt5 instead of QtScript?

According to

stellarium/CMakeLists.txt

Lines 480 to 482 in 2533f48

IF(ENABLE_SCRIPT_QML)
SET(MINIMAL_QT_VERSION "5.14.0")
ADD_DEFINITIONS(-DENABLE_SCRIPT_QML)
it should work

Ref https://bugs.gentoo.org/916113 - QtScript is going to be removed from Gentoo

@10110111
Copy link
Contributor

While I don't have the answer to your question, I wonder why Gentoo bothers to change configuration of a legacy Qt version. Shouldn't all the effort go to the current one, and the legacy version be frozen in maintenance mode?

@gzotti
Copy link
Member

gzotti commented Oct 23, 2023

QtScript is part of Qt5.15 (LTS), and other software based on Qt5 may use it, so why is it removed? If you entirely remove Qt5 from Gentoo, just switch to Qt6. We have not tested QML with Qt5 recently and do not recommend it in an "official" distribution, given less functionality. It would just confuse users.

@a17r
Copy link

a17r commented Oct 24, 2023

  1. There is no such thing as maintenance mode in a source-based distribution. Every package we provide must be able to build with an up to date toolchain, newer versions of dependencies that may not be able to sit side-by-side on a system without downstream modifications. We can not just let old packages sit there like in a binary distro.
  2. There is no such thing as a clean sweep switch from Qt5 to Qt6 for distributions, it is a drawn-out process. Sometimes upstreams even need to be made aware of the need for porting in the first place, sometimes no one answers anymore, that's when you flag stuff for removal downstream.
  3. QtScript is "part of" 5.15 LTS, but it has not received any fixes in years - it is deprecated since 5.5 already, but even then had only been provided for compatibility to Qt 4 in the fist place. It is a dead end with many known issues and that makes it a prime target to identify troubled reverse dependencies early, and get downstream maintainers to communicate with upstreams. Stellarium, therefore, showed up in that list.

The good news is that you've already ported to Qt6, and Gentoo's downstream maintainer for Stellarium provides that option. Unfortunately, Qt6 applications will look bad in Qt5-based DEs for some time to come, which means Qt6 build option would be a bad default until well into 2024.

So, the worst thing that would happen to Stellarium is to look slightly out of place. It is, however, the only piece of software I've seen to choose to keep a QtScript codebase in the process of porting to Qt6, that makes it the odd one out.

@DarthGandalf
Copy link
Contributor Author

Unfortunately, Qt6 applications will look bad in Qt5-based DEs for some time to come, which means Qt6 build option would be a bad default until well into 2024.

Stellarium does its own UI, independent from the Qt widgets theme, so this is not actually a concern here. So I guess I should just disable the Qt5 option for the Stellarium Gentoo package

@gzotti
Copy link
Member

gzotti commented Oct 24, 2023

I have zero time this week for fixes. What kinds of error appear when you build with Qt5 and QML script? This is just the option nobody wants, given the demise of pauseScript() in QML.

@a17r
Copy link

a17r commented Oct 24, 2023

That seems to imply Stellarium with Qt6 QML does not have the same limitations/less functionality as a theoretical Qt5 QML version?

@DarthGandalf: Possible, the only downside is potentially pulling in both qtwebengine slots for some users - but they can disable it, and QtWebEngine5 will only be the next tracker to identify porting stragglers.

Please note there is no hurry here. The qtscript-removal tracker is a mid-longterm process.

@gzotti
Copy link
Member

gzotti commented Oct 24, 2023

QML-based scripting has lost the ability to pause/resume script execution. Until a JS genius fixes that for us, we recommend "staying at Qt5" (implying "using QtScript", although QML should technically work with Qt5.15) when this is essential for some users. Else, some syntactic changes (3D vectors, colors) can be overcome by applying common new syntax in both versions.

@DarthGandalf
Copy link
Contributor Author

@gzotti who is supposed to call resumeScript()? I see the function defined, but noone seems to call it, so after a script called pauseScript() there's no way for it to resume?

@10110111
Copy link
Contributor

@DarthGandalf see this line:

actionsMgr->addAction("actionResume_Script", datetimeGroup, N_("Resume script execution"), this, "resumeScript()", "Ctrl+D, R");

@DarthGandalf
Copy link
Contributor Author

DarthGandalf commented Oct 25, 2023

ok, I see the problem.

If the script itself called core.pauseScript(), stellarium could do the same explicit event processing like it does now using QScriptEngineAgent, and similar to what it does in core.wait(), even in Qt6, until user resumes it via GUI.

However, there's no good way to pause the script via GUI, when the script didn't expect that itself. The best option I see is to check isPaused in every JS-callable function of StelMainScriptAPI... and all other functions callable from JS. That does somewhat decrease the frequency when exactly the script would be paused

@alex-w alex-w added this to Needs triage in Scripting via automation Oct 26, 2023
@alex-w alex-w added the qt Issues, related to Qt framework label Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qt Issues, related to Qt framework
Projects
Scripting
  
Needs triage
Development

No branches or pull requests

5 participants