[Interest] Two QCoreApplication objects with a twist

Jean-Michaël Celerier jeanmichael.celerier at gmail.com
Fri Nov 17 09:55:14 CET 2017


Wouldn't it be simpler to recompile the shared library with a namespaced
version of Qt ? (eg build Qt from source and pass "-namespace myqt" to the
script IIRC ; this puts every Qt class in a namespace, hence they would
appear as different functions & statics).




-------
Jean-Michaël Celerier
http://www.jcelerier.name

On Fri, Nov 17, 2017 at 9:17 AM, Lorenz Haas <lykurg at gmail.com> wrote:

> Hi,
>
> you can't use two QCoreApplication instances in a single application,
> I know. There's also a nice warning:
> https://github.com/qt/qtbase/blob/5.10/src/corelib/kernel/
> qcoreapplication.cpp#L795.
> The reason, I guess, has to do with the static variables used in QCA
> (?).
>
> Now, however, please imagine the following scenario and please be
> assured that I am neither convinced by nor advising such an
> architecture:
>
> - Win32 based
> - Main Application uses Qt5 with QApplication
> - Shared library linked against Qt4 (Core)
> - Qt5-Application uses the library
> - This Qt4-linked library starts an Qt4-QCoreApplication (for being
> able to use Signal/Slots).
>
> What are the technical reasons why you should also not do that, if
> there are? ... because static variables do not count in that scenario,
> at least I think so.
>
> Thanks
> Lorenz
> _______________________________________________
> 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/20171117/fe496741/attachment.html>


More information about the Interest mailing list