问题描述
在静态构建我的 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?
任何帮助将不胜感激.
推荐答案
这有点晚了,但希望它可以为别人节省一些时间.
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(小部件)"失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!