QTimer suspended!
Hi,
I develop a Saifish application
I have used QTimer like this
timer = new QTimer();
connect(timer, SIGNAL(timeout()), this, SLOT(PlayAudio()));
timer->start(60000);
void PlayAudio(){
if (time=2*3600)
audio.play()
}
}
but if my device sleep the timer is suspended by the OS! and the audio is not played
Rem: the timer restart if the screen of the device is on!
Please help me; what can I do to let QTimer running all time?
I use c++ for calculate the time to play *.mp3 and qml to UI and store settings.
My application must notify the user when a certain time of the day is reached.
I want that my application wake up the device from suspend at correct time and play a *.mp3
you could do the followong:
1) check time when your timer has started
2) runOntriggered = true
3) add check if current time is more then time from 1) plus 60000
Or you can prevent your device from sleeping, although it will drain battery and it will probably won't get passed in harbour
virgi26 ( 2015-11-02 09:53:20 +0300 )editsame thing can be done with Sailfish Clock application :)
coderus ( 2015-11-02 14:49:59 +0300 )edit