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

make Core a QML module #49

Open
maidamai0 opened this issue Dec 19, 2019 · 3 comments
Open

make Core a QML module #49

maidamai0 opened this issue Dec 19, 2019 · 3 comments

Comments

@maidamai0
Copy link
Contributor

I noticed all QML types like vtk.actor are registered to qmlengine by qmlRegisterType family functions in c++ code.Have you cansidered to make them a standalone QML module use qmldir so everyone can use it in QML like the native QML types without register it in c++ code.?

@maidamai0 maidamai0 changed the title make Core a qml module make Core a QML module Dec 19, 2019
@qCring
Copy link
Owner

qCring commented Dec 19, 2019

I'm not sure I understand correctly. The C++ classes are always necessary in order to use VTK types in QML. So you will always have a dependency to the C++ implementation and therefore the QuickVtk Core library. This is why I deliberately left type registration on the C++ side.

I assume you mean QML Plugins, right? That would be possible but the only advantage I can see is a better integration with QtCreator and .pro files. I'm not saying that this is not relevant. But I think it makes more sense to stick to CMake to handle project dependencies. Plus, QML Plugins are also just libraries, so I'm not too sure if moving the QuickVtk Core to such a plugin would really change things. But please correct me if I'm wrong since I didn't really spent too much time on this topic. I'm always happy for every single bit of feedback and fresh ideas!

@maidamai0
Copy link
Contributor Author

Yes, I mean QML Plugins.If QuickVtk Core is made to a QML Plugins, it will act like a native QML type just like Rectangle QML Type.Everyone who wants to use vtk in QML just need copy the qmldir file and the library file and add a path to QML Import Path.

Just like creating a QML bindings for vtk and I find this is convinent.With qmlplugindump you can give QtCreator code completion, again, like the native QML types 😊.

@qCring
Copy link
Owner

qCring commented Dec 19, 2019

Code completion is a good point though. Also, I just searched for Qt package managers (something like NuGet but for Qt) and found the qpm project (GitHub link). So yeah, there are some good reasons to consider QML Plugins. I'll keep this issue open for now and come back to this later. Right now, I'm working on a somewhat big refactoring to clean up the project and the GitHub Pages project documentation. Might take a bit but things are looking good. I'm planning on this to be done in the next week(s). After that I'll have some time for further research!

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