Assertion failed using Qt and Cocoa on MacOSX Mavericks

I’m developing a program with a GUI using Qt and Root following these guidelines. Under Linux I have no problem; however under OSX Mavericks I get the following error (I compiled Root libraries with debug symbols):

This happens with Root 5.34.25 and Qt 4.8.6. I don’t know if this is a bug or a mistake of mine. I can provide further details on demand if someone is willing to help me investigating this issue.
Thanks.

This means the drawable (window/“pixmap”/“ximage”) was not created by ROOT == ROOT Cocoa does not support ‘alien’ windows/views. Build your ROOT with --disable-cocoa, probably, ROOT + Qt will work with XQuartz.

With XQuartz at least the program starts. The Qt part works fine, however Root canvas show no content and the terminal is spammed by messages like these:

There is no magic - if you use Qt with Cocoa plugin/Carbon - their views/windows/whatever probably have no sense in XQuartz’s world. Build Qt with xcb plugin/X11.

Windows version is lucky since HWND/HANDLE is the same thing in Qt world and ROOT world.
Pixmap/Window - are the same integers in ROOT/QT world on unixes with X11.

This does not always have to be true on other platforms. And even more - Qt4/Qt5 are very different.

Thanks tpochep, I’m not an expert in these things but I understand that things are too difficult for my purposes. I could cope with rebuilding Qt on OSX using X11 but my colleagues won’t ever bother with this. My Qt/Root application should work in a stock system, and the only thing that I could ask them is to rebuild Root with some options. Is there any chance that this issue with Cocoa and Qt/Root will ever be addressed by the Root devs? Otherwise my application is on a dead end on OSX…

No, I’m afraid, the answer is ‘no’.

Hi,

We are using Qt in our gui together with GSI QtRoot interface.
For a long time it was no problem to compile it under Mac.
But this only was possible when Qt was compiled with X11 option (qt4-x11).
Such package was provided via macports.
Unfortunately, it is no longer available.
Just type in google ‘macports qt4-x11’.
Without such option QtRoot interface does not works.

Regards,
Sergey

Hi Sergey, I’m currently trying to build Qt with the -carbon option. Will this make Qt use XQuartz? There is no clear reference on the web about this, at least none that I’ve been able to find.

Sorry, I am not active Mac user, therefore have no idea how good XQuartz implements X11 and
could one use it for QtRoot interface.