Hi,

I tried code like below and getting message:
QQmlComponent: Created graphical object was not placed in the graphics
scene.

import QtQuick 2.13
import QtQuick.Controls 2.12
import QtQuick.Window 2.13

Window {
    visible: true
    width: 640
    height: 480
    Button {
        anchors.centerIn: parent
        text: "show"
        onClicked: menu.popup()
    }
    Menu {
        id: menu
    }
    Component {
        id: component
        MenuItem {
        }
    }
    Component.onCompleted: {
        var item = component.createObject(menu)
        item.text = "test menu"
        menu.addItem(item)
    }
}

Am i doing something wrong? Or it is a BUG in Qt ?

Regards

Tom

-- 
Tomas Konir
Czech Republic
_______________________________________________
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to