[Interest] "-glib" has no effect?
Nikos Chantziaras
realnc at gmail.com
Sat Feb 21 23:53:00 CET 2015
On 21/02/15 05:56, Thiago Macieira wrote:
> On Saturday 21 February 2015 04:34:07 Nikos Chantziaras wrote:
>> is there a way to detect at runtime whether Qt has glib support?
>> Right now I'm simply assuming that all Linux users have a Qt built
>> with "-glib" (so in that case a glib event loop is not used.) But
>> can the case where it was built with "-no-glib" be detected?
>
> I'd do this:
>
> auto mainThread = QCoreApplication::thread();
> auto mo = QAbstractEventDispatcher::instance(mainThread)->metaObject();
> if (strcmp(mo->className(), "QEventDispatcherGlib") == 0 ||
> strcmp(mo->superClass()->className(), "QEventDispatcherGlib") == 0)
> ....
>
> The two glib event dispatcher classes are called QEventDispatcherGlib and
> QPAEventDispatcherGlib. The latter derives from the former.
Thanks you, Thiago. You're very helpful, as always :-)
More information about the Interest
mailing list