TTKMusicPlayer  4.2.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
ttkeventloop.cpp
Go to the documentation of this file.
1 #include "ttkeventloop.h"
2 
3 TTKEventLoop::TTKEventLoop(QObject *parent)
4  : QEventLoop(parent)
5 {
6  m_timer.setInterval(10 * TTK_DN_S2MS);
7  connect(&m_timer, SIGNAL(timeout()), SLOT(quit()));
8 }
9 
11 {
12  quit();
13 }
14 
16 {
17  m_timer.setInterval(msec);
18 }
19 
20 int TTKEventLoop::exec(ProcessEventsFlags flags)
21 {
22  m_timer.start();
23  return QEventLoop::exec(flags);
24 }
25 
27 {
28  m_timer.stop();
29  return QEventLoop::quit();
30 }
31 
33 {
34  m_timer.stop();
35  return QEventLoop::exit();
36 }
QTimer m_timer
Definition: ttkeventloop.h:63
flags
Definition: http_parser.h:135
int exec(ProcessEventsFlags flags=AllEvents)
TTKEventLoop(QObject *parent=nullptr)
Definition: ttkeventloop.cpp:3
void setTimeout(int msec)
#define TTK_DN_S2MS
Definition: ttkglobal.h:355