1 Star 0 Fork 0

cpplibs/MyTestCode

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CppObject.h 677 Bytes
一键复制 编辑 原始数据 按行查看 历史
#ifndef CPPOBJECT_H
#define CPPOBJECT_H
#include <QObject>
#include <QDebug>
class CppObject : public QObject
{
Q_OBJECT
public:
explicit CppObject(QObject *parent = Q_NULLPTR)
:QObject(parent){}
signals:
//信号 --用来触发qml的函数
//注意参数为var类型,对应qml中js函数的参数类型
void cppSendMsg(const QVariant &arg1,const QVariant &arg2);
public slots:
//槽函数 --用来接收qml的信号
void cppRecvMsg(const QString &arg1,const QString &arg2){
qDebug()<<"CppObject::cppRecvMsg"<<arg1<<arg2;
qDebug()<<"emit cppSendMsg";
emit cppSendMsg(arg1,arg2);
}
};
#endif // CPPOBJECT_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cpplibs/MyTestCode.git
git@gitee.com:cpplibs/MyTestCode.git
cpplibs
MyTestCode
MyTestCode
master

搜索帮助