error: type 'QObject' is not a direct or virtual base of 'SendFile'


今天遇到了一个错误
详细信息如下
sendfile.cpp:3:39: error: type 'QObject' is not a direct or virtual base of 'SendFile'

在QtCreator中报错
在这里插入图片描述
很迷惑,为啥不能这样写

SendFile是我自己定义的一个类

问题解决方法:

加上继承QObject类
在这里插入图片描述


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM