如何修复'GLib-GObject-WARNING / CRITICAL'

时间:2019-05-21 09:05:51

标签: c++ linux qt gtk

我正在Qt中编写一些代码,当我使用QColorDialog时,应用程序将冻结,并显示以下输出:

GLib-GObject-WARNING **: 10:53:36.573: cannot register existing type 'GtkWidget'

GLib-GObject-WARNING **: 10:53:36.573: cannot add class private field to invalid type '<invalid>'

GLib-GObject-WARNING **: 10:53:36.573: cannot add private field to invalid (non-instantiatable) type '<invalid>'

GLib-GObject-CRITICAL **: 10:53:36.573: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

GLib-GObject-WARNING **: 10:53:36.573: cannot register existing type 'GtkBuildable'

GLib-GObject-CRITICAL **: 10:53:36.573: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed

GLib-CRITICAL **: 10:53:36.573: g_once_init_leave: assertion 'result != 0' failed

GLib-GObject-CRITICAL **: 10:53:36.573: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

GLib-GObject-CRITICAL **: 10:53:36.573: g_type_register_static: assertion 'parent_type > 0' failed

GLib-GObject-WARNING **: 10:53:36.573: cannot add private field to invalid (non-instantiatable) type '<invalid>'

我在一个空白项目中尝试了相同的代码,并且可以正常工作。我正在使用以下代码来显示QColorDialog:

QColor m_color;
m_color = QColorDialog::getColor(m_color, this, QString(), QColorDialog::DontUseNativeDialog);

我已经尝试清除QtCreator缓存以删除/home/user/.config/QtProject,并且已经尝试删除项目中的.pro.user文件

我试图在Debian 9和Linux Mint 19.1 Cinnamon上运行,同样的问题。

0 个答案:

没有答案