[Solved] Delay in displaying the data in textEdit



  • Hai,

    I am reading the data from real time and it is stored in some variable QStringlist and I split the data with new line and stored in qstring variable, next displying this data in QlineEdit,

    my problem was while displaying the data I want some delay to each value but I am unable to do that.
    I tried following code
    @
    QStringList strLines;
    QString line_array[100];
    int i=0,j=0,k=0;
    foreach (QString line, strLines)
    {
    line_array[i++]=line;
    }
    for(j=0;j<=(i/8);j++)
    {
    ui4->lineEdit_AIV1->setText(line_array[k++]);

        ui4->lineEdit_AIV2->setText(line_array[k++]);
        
        ui4->lineEdit_AIV3->setText(line_array[k++]);
      
        ui4->lineEdit_AIV4->setText(line_array[k++]);
        
        ui4->lineEdit_AIV5->setText(line_array[k++]);
       
        ui4->lineEdit_AIV6->setText(line_array[k++]);
      
        ui4->lineEdit_AIV7->setText(line_array[k++]);
      
        ui4->lineEdit_AIV8->setText(line_array[k++]);
       
       QThread timer;
       timer.sleep(2);
    }@
    

    please any one suggetion me



  • The ui is only updated after you leave the method/function. So you basically make all the changes and it's displayed once afterwards.

    Maybe a QTimer that fires a slot function every now and then might help you.



  • But I want online updation is there any possible method to display the data



  • Now I am puzzled. You want online updates but they should be delayed?!
    Want I meant is: when data comes in, pass it to a slot that displays the first line. Afterwards fire a timer on itself, then display the next line and so on...



  • thank you for your reply using this mechanism I solved my problem


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.