Strange refreshing when displaying a Qml dialog from a QWidget-based window



  • Hello,

    I've searched around for a couple of hours but can't find this one out -- sorry if I missed it.

    I have a QWidget-based .ui form. When the user clicks a button I display a separate window displaying a Qml file as a dialog. I use this code:

    @QQuickView *view = new QQuickView();
    view->setResizeMode(QQuickView::SizeRootObjectToView);
    view->setSource(QStringLiteral("MyDialog.qml"));
    view->setWidth(800);
    view->setHeight(500);
    view->show();@

    This works, but I get bizarre refreshing artifacts as in this image: !http://i.imgur.com/M3rzVmX.png(screenshot)! (Note the slider, which has weird vertical interlacing, and the text box, which has rendered on top of itself.)

    When I spawn this Qml as the root window set in a QtQuick2ApplicationViewer everything is fine. So I'm guessing I'm spawing this incorrectly. I looked around a lot for how to spawn it, but everything I found about Qml + QWidgets was about putting a QWidget into a Qml window, which is not what I'm going for.

    Specs: Qt 5.3, running on Ubuntu 14.04.

    Thanks very much for any help,

    Alec


Log in to reply
 

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