Dlopen error in Qt application when saving canvas as .png

The same crash also happens if I just do on the main.cpp function:

gSystem->Load("libGQt.so");

Maybe it has something to do with this?

https://sft.its.cern.ch/jira/browse/ROOT-4932

Anyway, I have hacked the code so that I don’t get this segmentation violation, by changing line 4842 of TPad.cxx to:
if (false && gVirtualX->InheritsFrom("TGQt")) {
so that InheritsFrom does not get called.

Anyway, I think a fix should be provided for this issue, or at least a warning.