http://user.qzone.qq.com/892054726/blog/1471508263
https://github.com/sjinks/qt_eventdispatcher_libev
libev的手册: http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod
eventdispatcher_libev 使用方法
Usage (Qt 5)
Simply include the header file and instantiate the dispatcher in main()
before creating the Qt application object.
#
include
"eventdispatcher_libev.h"
int main( int argc, char** argv)
{
QCoreApplication::setEventDispatcher( new EventDispatcherLibEv);
QCoreApplication app(argc, argv);
// ...
return app. exec();
}
int main( int argc, char** argv)
{
QCoreApplication::setEventDispatcher( new EventDispatcherLibEv);
QCoreApplication app(argc, argv);
// ...
return app. exec();
}
And add these lines to the .pro file:
unix { CONFIG += link_pkgconfig PKGCONFIG += eventdispatcher_libev}
else:win32
{
include(/path/to/qt_eventdispatcher_libev/lib/eventdispatcher_libev.pri)
}
or
HEADERS += /path/to/eventdispatcher_libev.h
LIBS += -L/path/to/library -leventdispatcher_libev
Qt 5 allows to specify a custom event dispatcher for the thread:
QThread* thr =
new QThread;
thr->
setEventDispatcher
(
new
EventDispatcherLibEv);
Qt自带的事件循环
Qt使用QSocketNotifier监听文件。 http://blog.csdn.net/qustdjx/article/details/7649508
Qt事件循环和IO设计的介绍https://www.qtdeveloperdays.com/2013/sites/default/files/presentation_pdf/Qt_Event_Loop.pdf ;