简体   繁体   中英

Is it possible to use QML and QtQuick without QApplication?

I am looking for a way to write an audio plugin using Qt. Audio plugins usually are dynamic libraries, not applications ( http://teragonaudio.com/article/How-to-make-VST-plugins-in-Visual-Studio.html ). While searching, I found on the audio forum contains the post QT etc for vst UI :

QtQuick/QML is perfect for any GUI development, including plugins. The only downside is that the payload is big (size of deployment). But that's really just the installation size and none of it affects performance. There are numerous ways to inject QtQuick scene graph to a window and not all of them are tied to or limited by the QApplication fake singleton. Gluing generic C++/Boost to Qml is made simple and thread-safe and Qt Quick scene graph itself runs mostly on GPU.

It's really just best to avoid all the QApplication and old Qt graphics framework techniques. They were good for maybe KDE and embedded systems (dentists chairs) ten years a go. QML made all that obsolete. For KDE also by the way.

Are these statements correct?
How can one use Qml and Qt Quck without QApplication in a c++ project? Can I use qtbase module in such a project?

I read through all the posts in your link and I think the author was being very loose with his terms. When he says:

It's really just best to avoid all the QApplication and old Qt graphics framework techniques.

He appears to simply be referring to avoiding Qt Widgets. The docs say "QApplication specializes QGuiApplication with some functionality needed for QWidget-based applications." In another post, he points to a QQuickRenderControl example, which he doesn't provide a link to, but I assume is this . That example uses QML along with a QGuiApplication, just not a QApplication.

Qt has examples for creating plugins for Qt-based applications. If you're wanting to use Qt to create a plugin for a non-Qt application, then it might work, but be prepared to have to ship the Qt libraries with your plugin, and you probably will still need a QGuiApplication. I don't really see a way around that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM