Signal QQmlEngine::quit() emitted, but no receivers connected to handle it quit信号无法接收解决方案 Qt5.7

编程入门 行业动态 更新时间:2024-10-13 10:23:22

Signal QQmlEngine::quit() emitted, but no receivers connected to handle it quit<a href=https://www.elefans.com/category/jswz/34/1770365.html style=信号无法接收解决方案 Qt5.7"/>

Signal QQmlEngine::quit() emitted, but no receivers connected to handle it quit信号无法接收解决方案 Qt5.7

问题如题,如果使用的是Rectangle,在main.cpp中include QQmlEngine库,再加上
QObject::connect(viewer.engine(), SIGNAL(quit()), &app, SLOT(quit()));

即可。&app也可以用qApp替代。qApp是一个宏。

官方帮助文档:
This function causes the QQmlEngine::quit() signal to be emitted. Within the Prototyping with qmlscene, this causes the launcher application to exit; to quit a C++ application when this method is called, connect the QQmlEngine::quit() signal to the QCoreApplication::quit() slot.

以下是修改安老师的变色矩阵的代码:

main.cpp:

更多推荐

Signal QQmlEngine::quit() emitted, but no receivers connected to handle it quit信

本文发布于:2024-03-23 18:35:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1741450.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:信号   解决方案   quit   emitted   Signal

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!