[Qt-interest] Segfault when opening a QMessageBox::about

Bastiaan Naber bastiaannaber at gmail.com
Sun Mar 7 21:17:16 CET 2010


Hi,

I'm making an experimental application to see if I can use Qt with our 
research software. This software doesn't allow me to make threads or let 
someone hijack the main event loop. I have been able to intergrate Qt by 
creating a timer and calling:

processEvents(); of QApplication 

every x mil seconds. This works fine and I have been able to create a window 
with some buttons on it. Even the Qt OpenGL example can be intergrate in this 
way.

However I can't seem to open and QMessageBox-es by calling one of their static 
methods. When I try this my application segfaults somewhere in 
kernel_qwidget_x11.cpp:

XSetWMProperties(dpy, id, 0, 0,
                         qApp->d_func()->argv, qApp->d_func()->argc,
                         &size_hints, &wm_hints, &class_hint);

This is the statement that results in the crash:

QMessageBox::about( this, "Example",
                        "This example demonstrates simple use of Qt");

Nothing spectacular I would say. This works offcourse if execute the Qt 
eventloop exec() but I really can't do this.

Does anyone have any ideas about what is going on? I'm using Qt 4.6.2 on 
CentOS. I do have core dump if this helps.

Thanks in advance,
Bastiaan



More information about the Qt-interest-old mailing list