[Qt-interest] QUiLoader's method "load" used in custom widget results in "Segmentation fault" in Linguist

Friedemann Kleint Friedemann.Kleint at nokia.com
Wed Jul 20 16:57:21 CEST 2011


Hi,

> I'm writing an interface program and it came time to internationalize it,
> so I started reading the Qt Documentation. I was happy to see that all
> forms loaded by QUiLoader are automatically translated, but I stumbled on
> a problem. Almost the whole interface consists of custom widgets that are
> put in the forms from designer. Some of the custom widgets use their own
> forms that they load using QUiLoader class and here the problem appeared.
> When I start Linguist and choose a translation that is located on a form
> that uses some of my custom widgets the program ends with "Segmentation
> Fault". 

The issue is currently that  libQtUiTools.a is a statically linked library 
that gets linked against the Designer plugin and Linguist (or any other 
application using QUiLoader). libQtUiTools.a contains static data whose 
instances apparently clash when using some compilers.
This was changed in the Qt 5 development branch.

Generally, we recommend against using QUiLoader for custom widgets, though.
Alternatively, you could use the code uic generates for the custom widget, 
streamline it a bit and use it in the custom widget constructor.

Regards,
Friedemann
-- 
Friedemann Kleint
Nokia, Qt Development Frameworks



More information about the Qt-interest-old mailing list