Hi All ,
have a text file in the format
#n X Y Z
0 123 456 789
1 321 654 987
2 345 243 809
......
.....
...... and so on
now i am reading the contents of the datum number(n) and X Y Z values using QRegExp but if try to read i am getting ASSERT problem please help us here is my code and error msg
void DatumForm::readfile()
{
QString result;
QFile file( "datum.txt" );
if ( file.open( IO_ReadOnly ) ) {
QTextStream stream( &file );
QString line;
int linenumber = 0;
while ( !stream.atEnd() ) {
line = stream.readLine();
QRegExp rx ( "^\\d\\d?$" );
rx.search ( "Datumno_Val" );
result = rx.cap ( 0 );
resulttemp = result;
printf( "%3d: %s\n", linenumber++, line.latin1() );
//lines += line;
}
file.close();
}
}
void DatumForm::init()
{
Datumno_Val = DatumVal;
datumnolineEdit->setFocus();
decimals_mm_datum = 3;
readfile();
QStringList lines = QStringList::split( FIELD_SEP, resulttemp );
Datumno_Val = lines[0].toInt();
qDebug ( "Datum number : %d",Datumno_Val);
Xdatum_Val = lines[1].toDouble();
xdatcountlineEdit->setText(QString::number( Xdatum_Val, 'f', decimals_mm_datum) );
qDebug ( "Xdatum_Val : %4.3lf",Xdatum_Val);
Ydatum_Val = lines[1].toDouble();
qDebug ( "Ydatum_Val : %4.3lf",Ydatum_Val);
Zdatum_Val = lines[1].toDouble();
qDebug ( "Zdatum_Val : %4.3lf",Zdatum_Val);
}
#######Error Msg##########
Key Press Event:: DATUM
0: 0:123.000:456.000:789.000
Datum number : 0
ASSERT: "i <= nodes" in /usr/lib/qt3/include/qvaluelist.h (373)
Xdatum_Val : 0.000
ASSERT: "i <= nodes" in /usr/lib/qt3/include/qvaluelist.h (373)
Ydatum_Val : 0.000
ASSERT: "i <= nodes" in /usr/lib/qt3/include/qvaluelist.h (373)
Zdatum_Val : 0.000
Bookmarks