QT5不能初始化类型的对象参数' storst qthread'带有类型的表达式' name1thread;
我会收到错误:
无法用类型的“ const qthread”的对象参数使用类型为'name1thread'的表达式
从我的标题文件中的代码段,称为'name1.h':
#include <QThread>
...
class name1;
class name1Thread : public QThread
{
Q_OBJECT
public:
void stop()
{
if(this->isRunning()) //Error occurs here
{
mRunning = false;
mCondition.notify_one();
}
}
我不明白为什么这是'工作;请帮忙。
I'm getting the error:
cannot initialize object parameter of type 'const QThread' with an expression of type 'name1Thread'
A snippet of code from my header file, called 'name1.h':
#include <QThread>
...
class name1;
class name1Thread : public QThread
{
Q_OBJECT
public:
void stop()
{
if(this->isRunning()) //Error occurs here
{
mRunning = false;
mCondition.notify_one();
}
}
I don't understand why this isn't working; please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论