qml2不存在的附加对象ImageParticle

时间:2013-11-11 06:52:47

标签: qt qml

当我尝试在qml2中使用ImageParticle构建粒子系统时,编译器会出现此错误:

Non-existent attached object 
         ImageParticle:{ 
        ^

以下是我的代码部分:

import QtQuick 2.0
import QtQuick.Particles 2.0
Item {
id:particle
anchors.fill: parent
Rectangle{

anchors.fill: parent
ParticleSystem{
    id:petalParticleSystem
}
ImageParticle:{
        source:"image/Petal.png"
        system:petalParticleSystem
}

1 个答案:

答案 0 :(得分:1)

为什么你没有冒号

ParticleSystem{

Rectangle{

但你在这里有吗?

ImageParticle:{

我认为这就是错误信息的含义。