i tried to add a new structure but i'm experiencing a new error as it says i cannot use RepCount, setX, setY and setZ as function. can i know what is wrong with my code?
struct FileData
{
double RepCount, setX, setY, setZ;
};
{
if(!mFile.
open(QFile::ReadOnly)) {
qDebug()<< "could not open file for reading";
return;
}
QList<FileData> points;
while(!mFile.atEnd())
{
FileData vec;
vec.RepCount(list.at(0).toInt());
vec.setX(list.at(1).toInt());
vec.setY(list.at(2).toInt());
vec.setZ(list.at(3).toInt());
points << vec;
}
mFile.close();
}
struct FileData
{
double RepCount, setX, setY, setZ;
};
void Read(QString Filename)
{
QFile mFile(Filename);
if(!mFile.open(QFile::ReadOnly))
{
qDebug()<< "could not open file for reading";
return;
}
QList<FileData> points;
while(!mFile.atEnd())
{
QString line = mFile.readLine();
QStringList list = line.split('|');
FileData vec;
vec.RepCount(list.at(0).toInt());
vec.setX(list.at(1).toInt());
vec.setY(list.at(2).toInt());
vec.setZ(list.at(3).toInt());
points << vec;
}
mFile.close();
}
To copy to clipboard, switch view to plain text mode
in addition, i'm still unsure of how to call out the individual values which i stored and then assign them to new objects( such as i want to name the X coordinate of Rep 2 and point it to Rep2coordX so that i can use Rep2coordX in future to do some calculations).
Thanks alot for the help so far
Bookmarks