不能在QThread的run()里面使用new开辟内存
ASSERT failure in Qwidget: "widgets must be created in the GUlthread.", file kernel\gwidget.cpp, line 1147


本文指出在Qt的QThread的run()方法中不允许使用new操作来分配内存,因为必须在GUI线程中创建QWidget。这可能导致ASSERTfailure,强调了多线程编程时GUI线程安全的重要性。
不能在QThread的run()里面使用new开辟内存
ASSERT failure in Qwidget: "widgets must be created in the GUlthread.", file kernel\gwidget.cpp, line 1147


2271
490
2971

被折叠的 条评论
为什么被折叠?