5
votes

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.

3

3 Answers

11
votes

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();
}
3
votes

In PyQt5 you can use the following code to avoid the problem.

app = QApplication()
app.setStyle('Fusion')

I think it is a problem of style 'GTK+'.

0
votes

I also had this problem with static build of Qt. If you put this code before everything else in main method problem goes away:

#ifdef Q_WS_X11
    qputenv("LIBOVERLAY_SCROLLBAR", 0);
#endif