[Development] C++ QML Interface thoughts

techabc techabc at gmail.com
Tue Jan 20 18:32:02 CET 2015


Is there any plans to complite QT QUICK for desktop as QWidgets as well?

2015-01-07 22:11 GMT+08:00 Luke Parry <pumpkinteapot at gmail.com>:

> Hi Bo,
>
> Thank you for your advice. I think one fault lies is my confidence of
> whether QML is right for the job due to my inexperience.
>
> Currently my GUI is QML which is fantastic but I'm still unsure on the
> best approach I will take for the backend. The motivation for the question
> is justifying the long term design, such as potentially supporting other
> language bindings, user defined scripting / implementations.One case study
> that made me think of using this approach, is from a talk at Dev Days 2012
> for Ipo.Plan (https://www.youtube.com/watch?v=kvWeE3kurEQ)
>
> I know my reply isn't technical but perhaps someone knows a good resource
> that may help?
>
> Also, would you be happy to send a pdf of your slides from the talk you
> held Qt Dev Days?
>
> Huge Thanks,
> Luke
>
> On 7 January 2015 at 12:17, Bo Thorsen <bo at vikingsoft.eu> wrote:
>
>> Den 06-01-2015 kl. 12:47 skrev Luke Parry:
>> > I am having issues trying to implement a c++ qml interface/wrapper that
>> > supports virtual overrides. Something functionally similar to
>> > boost::python would be excellent.
>> >
>> > This should be generic enough to also support non-QObject classes too so
>> > it rules out signals and slots. On first glance, it is fairly trivial to
>> > implement a wrapper that calls methods for the pointer, however
>> > implementing virtual overrides soon becomes difficult.
>> >
>> > I want to achieve something like this ( http://pastebin.com/t3k957Hf )
>> > In principle, this would work creating instances in QML but not the
>> > other way  transforming from a c++ instance.
>> >
>> > Is this feasible with QML without some compromise?  I would like to
>> > think I'm missing something subtle or something blatantly obvious.
>>
>> Sounds to me like you're basically recreating the QObject based
>> connection between QML and C++ without using QObject.
>>
>> That seems silly to me. If you're going to do this, accept that you're
>> using QObject based subobjects and then you don't need to do this at all.
>>
>> Anyway, if you insist on doing this, the trick would probably be to make
>> the QObject wrapper object have a pointer to the real non-QObject
>> object. Use aggregation instead of inheritance.
>>
>> Bo Thorsen,
>> Director, Viking Software.
>>
>> --
>> Viking Software
>> Qt and C++ developers for hire
>> http://www.vikingsoft.eu
>> _______________________________________________
>> Development mailing list
>> Development at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/development
>>
>
>
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20150121/23c57cf7/attachment.html>


More information about the Development mailing list