Important: Please read the Qt Code of Conduct -

Error on second dinamicaly created object(QCoreApplication::postEvent: Unexpected null receiver) if this object have SoundEffect.

  • I create some object dinamicaly

    function createMobs() {
        var x1,y1;
        var component = Qt.createComponent("../content/Zobie1.qml");
        for (var i=0; i<5; i++) {
            x1=Math.ceil(Math.random() * i_tem.width);
            y1=Math.ceil(Math.random() * i_tem.height/3*2);
            var object = component.createObject(i_tem,{"x": x1, "y": y1, "opacity" :1 });
            zombi_count ++ ;

    File Zobie1.qml have SoundEffect

        SoundEffect {
            id: playSoundZobie
            source: "../sfx/ZombieWalk.wav"
            loops: SoundEffect.Infinite
            volume : 0.3

    First object created good, but from second I see error - QCoreApplication::postEvent: Unexpected null receiver - But object create normal and soundeffect work excelent. if I remove SoundEffect - no errors.
    In principle, everything works - but why does the error appear?

Log in to reply