c++ - 是否可以在没有 QApplication 的情况下使用 QML 和 QtQuick?

标签 c++ qt audio qml vst

我正在寻找一种使用 Qt 编写音频插件的方法。音频插件通常是动态库,而不是应用程序 (http://teragonaudio.com/article/How-to-make-VST-plugins-in-Visual-Studio.html)。搜索时,我发现在音频论坛上包含帖子 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.


这些说法正确吗?
没有 QApplication 怎么能使用 Qml 和 Qt Quck在 C++ 项目中?我可以使用 qtbase这样的项目中的模块?

最佳答案

我阅读了您链接中的所有帖子,我认为作者对他的条款非常宽松。当他说:

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


他似乎只是指避免使用 Qt Widgets。 docs说“QApplication 专门为 QGuiApplication 提供了基于 QWidget 的应用程序所需的一些功能。”在另一篇文章中,他指出了一个 QQuickRenderControl 示例,他没有提供链接,但我认为是 this .该示例使用 QML 和 QGuiApplication,而不是 QApplication。
Qt 有为基于 Qt 的应用程序创建插件的示例。如果您想使用 Qt 为非 Qt 应用程序创建插件,那么它可能会起作用,但要准备好将 Qt 库与您的插件一起提供,您可能仍然需要 QGuiApplication。我真的没有办法解决这个问题。

关于c++ - 是否可以在没有 QApplication 的情况下使用 QML 和 QtQuick?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64584239/

相关文章:

c++ - LLVM IR : Get LVALUE operand

c++ - (Qt Creator - 基于 Cpp 的应用程序)Q<Objects> VS 使用指针?

qt - 始终可见的 qml

Android:将 MP4 解复用到视频和音频中?

java - 将 pcm 转换为 .wav - 有噪音

c# - 为什么有些 wav 文件可以在我的 c# directsound 应用程序中播放,而有些则不能?

c++ - 使用#ifdef 检测编译器

c++构造函数使用不正确的参数类型来构造对象

c++ - CUDA 流和上下文

c++ - 使用 QSimpleXmlNodeModel 和 QTreeView