|
player:layer(QWidget *parent, const char *name,WFlags f):QWidget(parent,name,f){
inSoundTimer = new QTimer( this ); //inSoundTimer已在前面定义
inSoundTimer->start( 10, TRUE );
inSound = new QSound(QString("./sound/02.wav"));//目录正确,inSound已在前面定义
inSound->setLoops(-1);
connect( inSoundTimer, SIGNAL(timeout()), this, SLOT(inSoundSlot()) );
}
void Player::inSoundSlot(){
inSound->play();
} |
|