Important: Please read the Qt Code of Conduct -


  • hi everyone i need a way to read a text file in qlistwidget i use this code
    QFile file(thefilename);
    if( QIODevice::ReadOnly))
    QString line = "";
    line = file.readLine();

    its working but it is show the words which in the file in the list widget 3 times i mean if i have 2 words i find it will repeat the 2 words 3 times in the list so can anyone help me to solve this problem

  • Lifetime Qt Champion


    Might be a silly question but are you sure that this function is not called several times with the same file ?

Log in to reply