[Interest] Is QEventPrivate a remnant?

Nye kshegunov at gmail.com
Thu Feb 11 19:01:08 CET 2016


Hello,
It seems some elaboration is in order to explain why I've done that the way
I did. I'm wrapping around the OpenMPI library for purposes of running the
particular library with my applications on a cluster. What I'm trying to
achieve is to have the MPI messages come as events through Qt's event
delivery system in the "most natural" way possible. I don't intend do
disable the sockets, nor the timers, provided by the default
implementations of the event dispatchers, so for that purpose, I derive my
event dispatcher either from QEventDispatcherWin32 or QEventDispatcherUNIX
depending on the Q_OS_* macros. Then in the dispatcher's processEvents() I
pull the MPI messages before calling the superclass' implementation of the
aforementioned method. The platform specific event dispatchers are already
a part of the private API, so when deriving from QCoreApplication I've
taken the liberty to do the same for the private object, and to pass it
through the appropriate constructor. Additionally, I'm calling
the QCoreApplicationPrivate::eventDispatcher->startingUp(); and the
corresponding QCoreApplicationPrivate::eventDispatcher->closingDown();
functions as noted in the comments in the QCoreApplication source (and as
done in QGuiApplication).

I'm aware that I'm breaking binary compatibility, but since Qt and my
library will be built on the cluster manually (it's not installed, and
won't be at some point in the future) this doesn't seem to be such a
problem. However, any suggestions on how I could've done better by my code
are greatly appreciated!

Kind regards.

On Thu, Feb 11, 2016 at 7:40 PM, Nikos Chantziaras <realnc at gmail.com> wrote:

> On 11/02/16 15:45, Nye wrote:
>
>>  > You should not have done that.
>> How come? I shouldn't have derived from QCoreApplication or shouldn't
>> have used the private API?
>>
>
> Don't use the private APIs. If you want to create a QCoreApplication
> subclass, simply derive from that. Same for every other class.
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160211/2d163a9e/attachment.html>


More information about the Interest mailing list