0

I am developing an application on Qt where I need to fill a quite "big" label with some informations. I wrote this:

ostringstream convert;
convert <<"Le temps mis pour afficher les images depuis la base de données est de "<<deltat1<<"ms avec "<<files.length()<<" images"<<endl ;
ui->label_5->setText(convert.str().c_str());

but when I run the program, some parts of the text are out of label_5 bounds. How is it possible to properly display the text in the label (on several lines) ?

Thanks in advance

MysteryGuy
  • 1,091
  • 2
  • 18
  • 43
  • 2
    Take a look at the [word wrap property](http://doc.qt.io/qt-5/qlabel.html#wordWrap-prop). Although, if you have a lot of text then a read-only [`QTextEdit`](http://doc.qt.io/qt-5/qtextedit.html) might be a better choice. – G.M. Apr 22 '17 at 12:24
  • @G.M. Word wrap property is ok for me ! Thanks! – MysteryGuy Apr 22 '17 at 12:30
  • Possible duplicate of [QLabel auto multiple lines](http://stackoverflow.com/questions/12281396/qlabel-auto-multiple-lines) – m7913d Apr 22 '17 at 19:06

0 Answers0