Error: Tracer is not a type in Quick.Particles(solved)



  • Following the link below and i got compile error: Tracer is not a type

    http://qmlbook.org/ch08/index.html

    @

    import QtQuick 2.0
    import QtQuick.Particles 2.0

    Rectangle {
    id: root
    width: 480; height: 160
    color: "#1f1f1f"

    ParticleSystem {
        id: particleSystem
    }
    
    Emitter {
        id: emitter
        anchors.centerIn: parent
        width: 160; height: 80
        system: particleSystem
        emitRate: 10
        lifeSpan: 1000
        lifeSpanVariation: 500
        size: 16
        endSize: 32
        Tracer { color: 'green' }            //Tracer is not a type
    }
    
    ImageParticle {
        source: "assets/particle.png"
        system: particleSystem
    }
    

    }

    @


  • Moderators

    Indeed, this type is no part of Qt. I suspect it is a custom element created for the purpose of that book - to show the parent item (notice the green rectangle in the picture).

    Please search the book for more information about it. Most probably it is something simple like:
    @
    // Tracer.qml
    Rectangle {
    anchors.fill: parent
    }
    @


Log in to reply
 

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