Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gtk-CRITICAL **: IA__gtk_widget_style_get: assertion `GTK_IS_WIDGET (widget)' failed

After a static build of my qt application

./configure -static -debug-and-release  -confirm-license -nomake demos -nomake examples -nomake tools 

it works fine but I get several output messages yelling:

(MyApplication:32030): Gtk-CRITICAL **: IA__gtk_widget_style_get: assertion `GTK_IS_WIDGET (widget)' failed

Is there really a critical problem, should I rebuild qt with different option?

Any help will be appreciated.

like image 738
Oumaya Avatar asked Jan 30 '13 14:01

Oumaya


1 Answers

This is kind of late, but hopefully it will save someone else some time.

For me, the error was being caused by the combination of two things: QCleanlooksStyle and QTableWidget. On ubuntu, the default style is either QCleanlooksStyle or QGtkStyle (which inherits from QCleanlooksStyle). When a QTableWidget is painted with either one of these styles, I saw that error. My solution was something like this:

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    a.setStyle(new QPlastiqueStyle());

    MainWindow w;
    w.show();

    return a.exec();
}
like image 57
Joel Avatar answered Oct 15 '22 04:10

Joel