Giter Club home page Giter Club logo

qt_eventdispatcher_libev's Introduction

qt_eventdispatcher_libev Build Status

libev-based event dispatcher for Qt

Features

  • very fast :-)
  • compatible with Qt 4 and Qt 5
  • does not use any private Qt headers
  • passes Qt 4 and Qt 5 event dispatcher, event loop, timer and socket notifier tests

Unsupported Features

  • QSocketNotifier::Exception (libev offers no support for this)
  • Qt 5/Windows only: QWinEventNotifier is not supported (registerEventNotifier() and unregisterEventNotifier() functions are currently implemented as stubs)

Requirements

  • libev >= 4.0
  • Qt >= 4.2.1 (tests from tests-qt4 were run only on Qt 4.8.x, 4.5.4, 4.3.0, 4.2.1)

Build

cd src
qmake
make

Replace make with nmake if your are using Microsoft Visual C++.

The above commands will generate the static library and .prl file in ../lib directory.

Install

After completing Build step run

*NIX:

sudo make install

Windows:

nmake install

For Windows this will copy eventdispatcher_libev.h to ../lib directory. For *NIX this will install eventdispatcher_libev.h to /usr/include, libeventdispatcher_libev.a and libeventdispatcher_libev.prl to /usr/lib, eventdispatcher_libev.pc to /usr/lib/pkgconfig.

Usage (Qt 4)

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)
{
    EventDispatcherLibEv dispatcher;
    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

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();
}

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_eventdispatcher_libev's People

Contributors

sjinks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qt_eventdispatcher_libev's Issues

Failed to build with Qt 6.5.3

Hi @sjinks
I am trying to build this lib with Qt 6.5.3
Everything looks good except there is an error the link state

qt_eventdispatcher_libev/libqt_eventdispatcher_libev.a(eventdispatcher_libev.cpp.o): In function `EventDispatcherLibEv::hasPendingEvents()':
eventdispatcher_libev.cpp:(.text+0x135): undefined reference to `qGlobalPostedEventsCount()'

For more context, I can build this with Qt 6.3.1 but got this issue when upgrading to Qt 6.5.3
Here is the output for qGlobalPostedEventsCount 6.3.1
image
And here is the output for qGlobalPostedEventsCount 6.5.3
image
It seems that in the new version, they change the use of qGlobalPostedEventsCount
Do you have any idea?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.