QT5不能初始化类型的对象参数' storst qthread'带有类型的表达式' name1thread;

发布于 2025-01-24 06:39:43 字数 446 浏览 3 评论 0原文

我会收到错误:

无法用类型的“ 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文