[Interest] Opening Qt/Qml window inside host app

Nuno Santos nunosantos at imaginando.pt
Mon Nov 10 08:24:55 CET 2014


Hi Maurice,

I have tried to create a pthread (I have tried on a Mac) but when the plugin is opened, the app hang and crashes.

So far I have managed to simply instantiate a QtApplication inside the plugin app without calling exec and the window opens and the ui reacts to changes. I have the the plugin class extend q_object and it receives signals from the qt app. I don't know what are the limitations of the current approach.

Any thoughts?

Regards,

Nuno

> On 10/11/2014, at 06:44, Kalinowski Maurice <Maurice.Kalinowski at theqtcompany.com> wrote:
> 
> Hi,
> 
> there was a discussion about using Qt5 as a plugin in the past on this mailing list. Just check the archive.
> 
> In general, for VST2 your implementation of AEffEditor::open() should create the thread creating the application object and invoking exec(). That is the latest point you can use before it has to be created.
> 
> Not sure if you need to have Windows supported for your project, but if you do then you need to take care that the arguments passed to your own qapplication object are exactly the same the host has been given (GetCommandLineA(),...). I remember some checks via GetCommandLineA and not using QCoreApplication::arguments() and hence the mismatch caused an assert.
> 
> BR,
> Maurice
> 
>> -----Ursprüngliche Nachricht-----
>> Von: interest-bounces+maurice.kalinowski=theqtcompany.com at qt-project.org
>> [mailto:interest-bounces+maurice.kalinowski=theqtcompany.com at qt-
>> project.org] Im Auftrag von Nuno Santos
>> Gesendet: Sunday, 2 November, 2014 7:17 PM
>> An: Interests Qt
>> Betreff: Re: [Interest] Opening Qt/Qml window inside host app
>> 
>> It seems that I was doing something wrong and now I can open the Qt/Qml
>> window inside the plugin but it blocks the program because i'm calling
>> app.exec();
>> 
>> I need to move the execution of the app to another thread, I believe. Qt base
>> probably does the same within an iOS app, right?
>> 
>> Any thoughts about the best way to do this?
>> 
>> Thanks,
>> 
>> Regards,
>> 
>> Nuno
>> 
>> On 02 Nov 2014, at 18:00, Nuno Santos <nunosantos at imaginando.pt> wrote:
>> 
>>> Hi,
>>> 
>>> I was wondering if it is possible to instantiate and open a Qt/Qml window
>> inside a host app via plugin loading mechanism.
>>> 
>>> I'm trying to make a VST plugin have a Qml window for editing. The plugin is
>> loaded by the host app.
>>> 
>>> I have tried to do it on the plugin instantiation with the following code:
>>> 
>>> QQmlApplicationEngine engine;
>>> engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
>>> 
>>> But the host app crashes as soon as this code is called.
>>> 
>>> Any thoughts?
>>> 
>>> Thanks,
>>> 
>>> Regards,
>>> 
>>> Nuno Santos
>>> _______________________________________________
>>> Interest mailing list
>>> Interest at qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/interest
>> 
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list