159Fermer161
deleted2Le 09/08/2015 à 00:13
Bon, la suite. Je lis la doc de QThread.
Je tombe donc sur cette méthode : http://doc.qt.io/qt-5/qthread.html#setEventDispatcher
Et là je lis :
This is only possible as long as there is no event dispatcher installed for the thread yet. That is, before the thread has been started with start() or, in case of the main thread, before QCoreApplication has been instantiated
.
Révélation ! J'ai toujours instancié ma QApplication avant d'appeler setNativeEventFilter !
Je modifie donc mon code :
    native_event_filter = new NativeEventFilter;
    QAbstractEventDispatcher* aed = new QAbstractEventDispatcher;
    aed->installNativeEventFilter(native_event_filter);
    QApplication::setEventDispatcher(aed);

    QApplication app(argc, argv);
Seul souci, j'avais pas fait gaffe, mais abstract, ça veut dier abstrait en fait. Cette saloperie d'interface a 20 méthodes virtuelles pures :/