Important: Please read the Qt Code of Conduct -

Can QQuickWidget create a window by QML Window Element?

  • i use qquickwidget load a qml file, in the qml file i use a window element,
    but the window element not show.
    i don`t konw why, who can help me,thanks.

    (english is not good - -!)

    It is hard to figure out the reason without your source code...!
    A Window is not visible by default, did you set the visible property ?


  • @Charby
    my source:

    // mainwin.cpp
                           | (Qt::X11BypassWindowManagerHint)
                           | (Qt::Widget)
                           | (Qt::Window)
    // main.cpp
        QApplication app(argc, argv);
        MainWin w;;
        return app.exec();
    // main.qml
    import QtQuick 2.5
    import QtQuick.Window 2.2
    import QtQuick.Controls 1.4
    import QtQuick.Dialogs 1.2
    Rectangle {
        visible: true
        width: 800
        height: 600
        MouseArea {
            anchors.fill: parent
            onClicked: {
    //            Qt.quit();
        Text {
            text: qsTr("Hello World")
            anchors.centerIn: parent
        Button {
            text:"open a inner dialog"
            onClicked: {
                inner.visible = !inner.visible
        Window {
            visible: false
            flags:Qt.Dialog | Qt.FramelessWindowHint
            width: 100
            height: 80
            Text {
                anchors.centerIn: parent
                text:"i`m a inner dialog"

    when i click button the id:inner window don`t show~~

  • This might be a bug. I encountered several bugs in the field of non-standard QtQuick windows. Try if your code works correctly when all FramelessWindowHints are removed. Btw: Are you on Linux, Windows or Mac OS? What graphics card do you use? Which graphics driver is installed?

    Edit: This might be related to

  • @Wieland thank you .
    i removed all FramelessWindowHints buy the window still not show.
    i`m on windows8.1 with Intel(R) HD Graphics.

    so.i mush wait for [] fixed?

Log in to reply