Gtk-CRITICAL **:IA__gtk_widget_style_get:断言“GTK_IS_WIDGET(小部件)"失败 [英] Gtk-CRITICAL **: IA__gtk_widget_style_get: assertion `GTK_IS_WIDGET (widget)' failed

查看:42
本文介绍了Gtk-CRITICAL **:IA__gtk_widget_style_get:断言“GTK_IS_WIDGET(小部件)"失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在静态构建我的 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.

对我来说,错误是由以下两件事共同引起的:QCleanlooksStyleQTableWidget.在 ubuntu 上,默认样式是 QCleanlooksStyleQGtkStyle(继承自 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(小部件)"失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆