Results 1 to 20 of 20

Thread: Assert problem in line edit

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2009
    Location
    Bangalore
    Posts
    68
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Assert problem in line edit

    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
    Last edited by grsandeep85; 27th July 2009 at 07:17.
    Thanks & Regards
    Sandeep G.R.

Similar Threads

  1. Problem updating Line edit from a thread
    By raghvendramisra in forum Qt Programming
    Replies: 5
    Last Post: 3rd December 2007, 05:05
  2. Line Edit Controll problem
    By mansoorulhaq in forum Qt Programming
    Replies: 5
    Last Post: 31st October 2007, 08:33
  3. Replies: 8
    Last Post: 15th May 2007, 09:21
  4. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42
  5. Signal problem in Qline Edit
    By awalesminfo in forum Newbie
    Replies: 1
    Last Post: 3rd April 2006, 09:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.