-
Notifications
You must be signed in to change notification settings - Fork 75
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
Multithreading, QML, plugins and ... Crashes! #9
Comments
Ok, I did created a define called Anyway, if you want to see the progress, please check the repository on my userspace. My best regards! |
Hi @vltr,
I want to clarify your problem first. Are you calling both of Qt Quick and Quick Flux function in non-main thread? If my understanding is correct, it is not valid in Qt Quick. Although Qt Scene Graph may render content in non-main thread, Qt Quick itself is single thread. It should update its content on main thread only. (And that is why Quick Flux do not use mutex).
Yeah! It will be great. I don't really have time to handle CMake stuff. |
Hey Ben! I'm on traffic right now, but I think I did not explained the whole Best regards,
|
@benlau yeah, well, first the main problem, let me explain it a little better: I have an app that looks kind Qt Creator: it has a lot of plugins or, more specifically, plugin centered. Some of these plugins brings QML resources where I embed settings and some other features and, since Quickflux is very useful, I was porting some of my plugins to use it. But, starting it automatically (like in issue #7) in this case produced the same error (even if added to the main launcher project), leading me to believe that when loading plugins, that Qt macro used to solve #7 is called before any gui. It only worked when I called it after Does this sounds reasonable? My best regards, |
I see. So the requirement is to have an DEFINE to disable Qml types registration and a function to let user to register on their own type? I think it is fine to provide those functions. However, I don't suggest to use Quick Flux in a plugin because the AppDispatcher is a singleton object per QQmlEngine. Is it ok? |
Thanks, @benlau ! Yes, the I did not knew that as a plugin, it would cause such misbehavior. In case of a lib, shared, would it work fine (since I'll have to link to its lib and call the register function in my runnable anyway) ? Best regards, |
Added. |
Yay \o/ ! Thanks @benlau ! Now it's free for the user to set what he wants 😄 |
In my spare time I'll see what I can do with CMake. CMake is beautiful in the posix land, but in Widows ... Well, that's why I keep project files. The problem will be to choose one or another OR keep both in sync. |
Hello @benlau ! Me again. I hit the same problem while integrating QuickFlux into my application: it uses threads and plugins and everything weird that call all mutexes and locks in the world in Qt Quick and the problem appears again to me and the solution is now to call it by hand.
Well, can I make a suggestion or two? We can use defines to register (or not) the Qml types at runtime, letting users with more complex apps to decide and also test QuickFlux as a plugin for Qt itself -- instead of embedding it into the app. The first one is quite easy to accomplish, the second one I can work to make it happen.
I would like to help with CMake also (as yet open in issue #1) if some spare time help me. Meanwhile, I'll focus on .pro and .pri because CMake on Windows with MSVC is quite, well, you know.
Best regards,
Richard.
The text was updated successfully, but these errors were encountered: