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

Modify the cmake build to make use of Qt6 modern cmake features #207

Open
emmenlau opened this issue Mar 31, 2023 · 5 comments
Open

Modify the cmake build to make use of Qt6 modern cmake features #207

emmenlau opened this issue Mar 31, 2023 · 5 comments

Comments

@emmenlau
Copy link
Contributor

The QuickQanava build seems to be implemented before Qt offered the very helpful cmake tooling for QML modules. Much of what the build does manually can now be achieved much nicer with cmake tooling. There would be multiple benefits:

  • QuickQanava would provide automatically generated qmltypes files, which allow the Linter qmllint to work correctly
  • The manual maintenance of qmldir files is no longer needed
  • Installation with cmake works cleanly, which was requested already in Installing QuickQanava through CMake seems to be broken #165
  • The whole build system would be simpler and more consistent with Qt guidelines

For that, the build should follow https://doc.qt.io/qt-6/qt-query-qml-module.html#example

I can implement this and make a PR if people are interested?

@emmenlau
Copy link
Contributor Author

emmenlau commented Apr 6, 2023

I have created an implementation of this and can provide is soon as a PR. But I think this would also "modernize" quite a bit some other details of QuickQanava, and I wonder if that is acceptable?

Things that could/should be changed:

  • No longer a need for manually maintained qmldir files, they can be auto-generated
  • No longer a need to explicitly import the qrc-file in QML
  • No longer a need to explicitly register C++ QML types in the plugin
  • Maybe the whole manually created plugin is unnecessary? Modern Qt seems to do all that automatically?

@cneben
Copy link
Owner

cneben commented Apr 22, 2023

Hi @emmenlau, thank for you detailled BR: using newest Qt6 features is a very good idea and a good move to clean the build system.
Unfortunately, I am still stuck to Qt5.15 for at least few months on a closed-source project and I've no time to maintain two parallel branches... (moreover, Qt 6.5 will probably be the first stable version of Qt6 ;) )

If you are willing to maintain a Qt6 branch, I would be very happy to support your work and it would give our users (I know at least 4 commercial projects using QuickQanava) more time to prepare for change.

I am OK with all of your points (except perhaps no using qrc, I've bad memories about that, perhaps specific to Qt5). I would even add:

  • Switch to c++17 pehaps even c++20.
  • Remove every use of QVector and switch to std containers where possible (_selectedNodes, etc.), really the Qt move of switching QList / QVector make me want to stop using Qt option when there is an std alternative.

@emmenlau
Copy link
Contributor Author

Dear @cneben , thanks a lot for the thumbs up, sounds a good way forward! In the next two weeks we are completely booked with other projects, but afterwards I'm happy to share my progress and maintain it in a Qt 6 branch!

cneben added a commit that referenced this issue May 17, 2023
Signed-off-by: cneben <benoit@destrat.io>
cneben added a commit that referenced this issue May 18, 2023
Remove top level QuickContainers directory (not idiomatic for CMake).
quickcontainers is now fully integrated in QuickQanava source tree.

Signed-off-by: cneben <benoit@destrat.io>
cneben added a commit that referenced this issue May 18, 2023
Signed-off-by: cneben <benoit@destrat.io>
cneben added a commit that referenced this issue Nov 16, 2023
Signed-off-by: cneben <benoit@destrat.io>
cneben added a commit that referenced this issue Nov 17, 2023
Signed-off-by: cneben <benoit@destrat.io>
cneben added a commit that referenced this issue Nov 17, 2023
Remove top level QuickContainers directory (not idiomatic for CMake).
quickcontainers is now fully integrated in QuickQanava source tree.

Signed-off-by: cneben <benoit@destrat.io>
cneben added a commit that referenced this issue Nov 17, 2023
Signed-off-by: cneben <benoit@destrat.io>
cneben added a commit that referenced this issue Nov 17, 2023
Signed-off-by: cneben <benoit@destrat.io>
cneben added a commit that referenced this issue Nov 17, 2023
cneben added a commit that referenced this issue Nov 17, 2023
@emmenlau
Copy link
Contributor Author

I think recent master has some of these issues addressed, is that correct? Is this issue here fully covered, or what remains to nicely support modern Qt 6 cmake?

@cneben
Copy link
Owner

cneben commented Jan 31, 2024

Well, most of it, but I still maintain qmldir and qrc files + no use of QML_ELEMENT macro.
I think we should close that one that has too much history on old branches, but there is still a lot of work to do (I'am not sure it's 100% compatible with my actual proprietary code using .qrc so I won't put much energy on this until next major release (>=2.5).

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

No branches or pull requests

2 participants