Hi there,

Trying to read text out a .dat file I created but not having much luck... now trying code direct from trolltech site!:
bool ItemReader::read(ItemList* iList){
QFile file(fileName);
QDir::setCurrent("/TheStore");
file.setPermissions(QFile::ReadUser);
if(!file.open(QIODevice::ReadOnly|QIODevice::Text) ){
qDebug()<<"File not opening" << endl;
return false;
}
QTextStream in(&file);
QString line = in.readLine();
while(!line.isNull()){
QStringList itemProps =line.split(QRegExp("\\t"));
Item *addChild= new Item((itemProps.at(0)).toInt(),itemProps.at(1),ite mProps.at(2),(itemProps.at(3)).toInt());
iList->add(addChild);
line = in.readLine();
qDebug()<< line << endl;
//QString s =itemProps.at(1);
//qDebug() << s << endl;
//Item *one = new Item(0000,"fruit","apple",1);
//iList->add(one);
}
file.close();
qDebug() << "Read it!!" << endl;
return true;
}


Then want to call a QMainWindow SalesScreen from the main app Login.... but it flashes and does not stay on the screen... do I need to transfer control somehow?Q!
void Login::validate(){
if(valAdmin.exactMatch(enterPassword->text())){
result->setText("Administrator logged on");
}
else if(valSales.exactMatch(enterPassword->text())){
result->setText("Sales assistant logged on");
SalesScreen sale;
sale.setGui();
}
else if(valManager.exactMatch(enterPassword->text())){
result->setText("Manager logged on");
}
else{
enterPassword->clear();
result->setText("Invalid Login : enter password again");
}

}

Any help would be greatly appreciated