[SOLVED] QDeclarativeView -> QQuickView



  • @QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) : QQuickView(parent)
    {
    connect(engine(), SIGNAL(quit()), SLOT(close()));
    setResizeMode(QQuickView::SizeRootObjectToView);
    }@

    @
    qmlapplicationviewer.cpp:82: error: no matching function for call to 'QQuickView::QQuickView(QWidget*&)'
    QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) : QQuickView(parent)
    ^@

    I am trying to port code to 5.2.
    QDeclarativeView -> QQuickView

    I made that change and now don't know what to do next.


  • Moderators

    Create a new QtQuick project in QtCreator and copy the code for QmlApplicationViewer from there. If you really need it. Using plain QQuickView is easier, in my opinion.



  • I ended up just commenting out the member I was trying to directly initialize.

    @QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) // : QQuickView(parent)
    {
    connect(engine(), SIGNAL(quit()), SLOT(close()));
    setResizeMode(QQuickView::SizeRootObjectToView);
    }@

    Hope this doesn't have repercussions in the long run.


  • Moderators

    In general, QQuickView needs a QWindow, and not a QWidget (unless you use a QWindowContainer).


Log in to reply
 

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