Please bear with me ,
I defined those in the patient.cpp file:
{
in << patient.firstName;
in << patient.lastName;
return in;
}
{
out >> patient.firstName;
out >> patient.lastName;
return out;
}
QDataStream& QDataStream::operator<<(QDataStream &in, const Patient &patient)
{
in << patient.firstName;
in << patient.lastName;
return in;
}
QDataStream& QDataStream::operator>>(QDataStream &out, Patient &patient)
{
out >> patient.firstName;
out >> patient.lastName;
return out;
}
To copy to clipboard, switch view to plain text mode
but I got these errors at the opening curly brace of operator<<:
Multiple markers at this line
- non-inline function 'QDataStream& QDataStream::operator<<(QDataStream&, const
Patient&)' is defined after prior declaration as dllimport: attribute ignored
- prototype
for `QDataStream
& QDataStream::operator<<
(QDataStream
&,
const Patient
&)' does not match any in class `QDataStream'
- `QDataStream
& QDataStream::operator<<
(QDataStream
&,
const Patient
&)' must take exactly one argument
Multiple markers at this line
- non-inline function 'QDataStream& QDataStream::operator<<(QDataStream&, const
Patient&)' is defined after prior declaration as dllimport: attribute ignored
- prototype for `QDataStream& QDataStream::operator<<(QDataStream&, const Patient&)'
does not match any in class `QDataStream'
- `QDataStream& QDataStream::operator<<(QDataStream&, const Patient&)' must take
exactly one argument
To copy to clipboard, switch view to plain text mode
and these errors at the opening curly brace of operator>>:
Multiple markers at this line
- `QDataStream
& QDataStream::operator>>
(QDataStream
&, Patient
&)' must take exactly one argument
- prototype for `QDataStream& QDataStream::operator>>(QDataStream&, Patient&)'
Multiple markers at this line
- `QDataStream& QDataStream::operator>>(QDataStream&, Patient&)' must take
exactly one argument
- prototype for `QDataStream& QDataStream::operator>>(QDataStream&, Patient&)'
does not match any in class `QDataStream'
To copy to clipboard, switch view to plain text mode
what's wrong?
Bookmarks