Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Error on second dinamicaly created object(QCoreApplication::postEvent: Unexpected null receiver) if this object have SoundEffect.
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 438 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    alex_lip
    wrote on last edited by
    #1

    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 });
            object.objectName="zomb"+zombi_count.toString();
            console.log(object.objectName);
            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?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved