Reputation: 655
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.
Upvotes: 5
Views: 10352
Reputation: 151
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+'.
Upvotes: 3
Reputation: 1
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
Upvotes: 0
Reputation: 2824
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();
}
Upvotes: 11