Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. int line_counter=1;
  2. if(file.open (QIODevice::ReadOnly | QIODevice::Text))
  3. {
  4. while(!stream.atEnd())
  5. {
  6. line = stream.readLine ();
  7. if(!line.isNull ())
  8. {
  9. if((line_counter%5)==1)
  10. ui->comboBox->addItem (line);
  11. line_counter++;
  12. }
  13. }
  14. }
  15. stream.flush ();
  16. file.close ();
  17. void Servers::on_pushButton_clicked()
  18.  
  19. if(file.open (QIODevice::ReadOnly | QIODevice::Text))
  20. ui->textBrowser->setText(stream.readAll());
  21. stream.flush ();
  22. file.close ();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement