Qt5: QQuickView as child of QWidget?



  • Hi,
    I'd like to have a QQuickView (physically) next to a QGLwindow. Both as childs of a Qmainwindow.
    Still, QQuickView does not allow a Qwidget/QMaindow as a parent.
    Is there a workaround for this problem, or is it by default impossible to have both QWidgets and QQuickview?


  • Moderators

    You can use QtDeclarativeView and QML1 to mix with QtWidgets. Integrating QML2 into widgets is being worked upon right now, it will probably go into Qt 5.1 or 5.2.



  • thnks.
    Indeed, I did this already in Qt 4.8, while doing some tests to port an app from QtGui to Qt and QML.
    I don't want to port twice:
    now from qtGui to QML (1.0/Qt4.8) (a lot of work), and afterwards again from Qt4.8/QML1.0 to Qt5.x/QML2.0.
    Unless QML 1.0 will be supported for the coming years and new components are also supplied in QML1.0 (e.g. for Sailfisch devices, upcoming Android/iOS support).


  • Moderators

    [quote author="wspilot" date="1356352467"]Unless QML 1.0 will be supported for the coming years and new components are also supplied in QML1.0 (e.g. for Sailfisch devices, upcoming Android/iOS support).[/quote]

    I don't know. QtQuick1 is definitely going to be supported throughout Qt5 lifetime (so, easily 5-6 years), but to be sure - QML2 will be getting most of the attention. As for other OSes, I don't know what devs intend there, it's up to them to decide.

    Qt 5.1 is planed in spring 2012, these issues should be cleared up by then, either by concrete implementation (as is planned with droid and iOS), or at least in defined plans.



  • Ok. Thanks.
    I think the solution is (and maybe for others with the same issue) to create an interface class that handles the communication between the C++ (classes) and the QML GUI.
    That way at least the C++ is free of version specific hookins, and can remain unchanged when porting to QML2.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.