Hi,

I would like to use a QMessageBox in order to display the content of a txt file.
I am wondering if there is a possibility to activate an horizontal and/or a vertical scrollbar if the text from the file exceeds certain limits ?

This is my current code:

Qt Code:
  1. void
  2. MainWindow::credits() {
  3. QFile file(":/credits.txt");
  4.  
  5. if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
  6. return;
  7.  
  8. QMessageBox credits(QString("My Application"),file.readAll(),
  9. QMessageBox::NoIcon,
  10. QMessageBox::NoButton,
  11. QMessageBox::NoButton,
  12. this
  13. );
  14.  
  15. credits.exec();
  16.  
  17. file.close();
  18. }
To copy to clipboard, switch view to plain text mode