I'm making an apllication which needs to play .wav file when user type something inside QTextEdit. I made some code but after minute or less the sound stops, so I made silly workarround. After 30 clicks I invoke sound->stop(); and then the loop start again, that works, but it's not good, can you give better solution. Here is my code:
(tipka is Phonon::MediaObject)Code:int count = 0; bool MainWindow::eventFilter(QObject *o, QEvent *e){ if(e->type() == QEvent::KeyPress) { tipka->play(); tipka->seek(0); count++; if(count == 30){ tipka->pause(); count = 0; } } return false; }


Reply With Quote
Bookmarks