//main.cpp
#include <QtCore/QCoreApplication>
#include <QDebug>
#include <QObject>
#include "hhh.h"
namef::namef(QString s,QObject *parent=0): QObject(parent),names(s){}
void namef::startname(namef name1,int i){
connect(this,SIGNAL(sent(int)),&name1,SLOT(get(int)));
emit sent(i);
}
void namef::get(int i)
{
qDebug()<<"this is the "<<this->names<<"gets"<<i;
}
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
namef as("as");
namef b("b");
as.startname(b,7);
return a.exec();
}
//hhh.h
#ifndef HHH_H
#define HHH_H
#include <qobject.h>
#include <QDebug>
class namef : public QObject
{
Q_OBJECT
public:
namef(QString s,QObject *parent=0);
void startname(namef name1,int i);
virtual ~namef(){}
signals:
void sent(int);
public slots:
void get(int);
private:
QString names;
};
#endif // HHH_H
------解决方案--------------------
请问是什么错误信息