问题描述
在我的Qt应用程序的静态编译
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
是否真的有严重的问题,我应该使用不同的选项QT重建?
Is there really a critical problem, should I rebuild qt with different option?
任何帮助将AP preciated。
Any help will be appreciated.
推荐答案
这是有点晚了,但我希望它会拯救别人一些时间。
This is kind of late, but hopefully it will save someone else some time.
对于我来说,错误是由两件事引起的组合: QCleanlooksStyle
和 QTableWidget的
。在Ubuntu中,默认的样式或者是 QCleanlooksStyle
或 QGtkStyle
(从继承 QCleanlooksStyle
)。当 QTableWidget的
绘有这些样式任何一个,我看到了这个错误。我的解决办法是这样的:
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();
}
这篇关于GTK的CRITICAL **:IA__gtk_widget_style_get:断言`GTK_IS_WIDGET(部件)'失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!