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

After the 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 some output messages:

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

Is there really a critical problem, should qt be rebuilt with another option?

Any help would be appreciated.

+4
source share
3 answers

It's a bit late, but hopefully it will save someone else a bit.

For me, the error is caused by a combination of two things: QCleanlooksStyle and QTableWidget . In ubuntu, the default style is QCleanlooksStyle or QGtkStyle (which inherits from QCleanlooksStyle ). When a QTableWidget is colored with one of these styles, I saw this 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(); } 
+11
source

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

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

I think this is a "GTK +" style issue.

+3
source

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

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

All Articles