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

R Syntax: Load QML Controls as QML Module #5785

Merged
merged 22 commits into from
Feb 11, 2025

Conversation

boutinb
Copy link
Contributor

@boutinb boutinb commented Feb 4, 2025

Make the QML Components as a QML Module (by using the qt_add_qml_module cmake function).
This makes also possible to use this module as a plugin: this is needed for the R Syntax project

All versions in QML import statement must be removed.

No qmldir needed (it is generated automatically), and no need to register all the base QML objects: they are automatically registered via the QML_ELEMENT macro.

The QMLComponents module is a static library. To make it a shared library would be really painful on Windows: all the library (Common, CommonData), should be also dynamic, and export their object with dll_export macros, in order to solve all the problems correctly of static members. Also an extra dynamic library would be necessary to collect all the objects that are used in QMLComponents and Desktop.

As static library, there is no initialization of the module with the QML Engine, so the context objects needed by the QML Controls (jaspTheme, preferencesModel), some variables (DEBUG_MODE...), and the registration of the enum types must be done outside the module. This is done by the MainWindow class, and this must be done by the R package that will call the QML form.

boutinb and others added 20 commits February 4, 2025 17:29
The QML Module is also a plugin.

All versions in QML import statement must be removed.
Remove the CommonData to the QML Comnponent.
Only the Audit analyses use the CommonData objects (via the Filter object), but this leads to unexpected error: the sqlite library is added in the translation unit of the QML Component library.
Furthermore, n order to use the Filter object in the QML Component the whole DataSet object was exposed to the QML Component, which is completely inconsistent with the Provider/Consumer pattern used in the VariableInfo.
So in order to still be able to use the Filter object in the Audit analyses, callback functions are used instead, which are set in the DesktopCommunicator object.
Use QML_ELEMENT
Remove import version in other QML files
…o inside singleton() (but without creating the actual tablestructure, this remains the prerogative of DataSetPackage)
linux compiles and runs
linking fails under a variety of circumstances...
@boutinb boutinb requested a review from JorisGoosen February 4, 2025 16:55
Copy link
Contributor

@JorisGoosen JorisGoosen left a comment

Choose a reason for hiding this comment

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

Had to make a small tweak to fix some issue on windows when adding a column (through audit sampling for instance). With qt 6.8.2 if it makes a difference.

Works lovely now though!
Nice you figured out how to make it behave on Windows ^^

@JorisGoosen JorisGoosen merged commit f7c57b6 into jasp-stats:development Feb 11, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants