wxxl_csdn 2017-06-10 13:17 采纳率: 0%
浏览 2615

invalid use of member (did you forget the '&' ?)

#include "mythread.h"

Mythread::Mythread(QObject *parent) :
QThread(parent)
{
//初始化一般在构造函数中进行赋值
this->num=0;
}
void Mythread::run()
{
while(1)
{
emit wxy(this->num);
this->num++;
usleep (800*1000);
}
}

#ifndef MYTHREAD_H
#define MYTHREAD_H

#include

class Mythread : public QThread
{
Q_OBJECT
public:
explicit Mythread(QObject *parent = 0);

signals:
void wxy(int num); //自定义一个信号,每隔一段时间就发出去给MainWindow

public slots:

protected:

void run();

private:
int num();

};

#endif // MYTHREAD_H

  • 写回答

2条回答 默认 最新

  • devmiao 2017-06-10 15:57
    关注

    你忘记写 & 取地址了。

    评论

报告相同问题?

悬赏问题

  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题