【People.h】
#ifndef PEOPLE_H_
#define PEOPLE_H_
class People: public QObject{
public:
People(){
}
private:
QString name;
private:
QString age;
public:
QString getName() const{
return this->name;
}
void setName(QString name){
this->name = name;
}
QString getAge(){
return age;
}
void setAge(QString age) {
this->age = age;
}
public:
QString &operator<<(People stu);
bool operator==(const People& other);
void a();
};
#endif /* PEOPLE_H_ */
【People.cpp】
#include <People.h>
void People::a(void){
} //这个方法正常,为什么下个方法就报错呢
QString People::&operator<<(People stu){
} //此方法格式错误。