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:
void
MainWindow::credits() {
QFile file(":/credits.txt");
return;
this
);
credits.exec();
file.close();
}
void
MainWindow::credits() {
QFile file(":/credits.txt");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
return;
QMessageBox credits(QString("My Application"),file.readAll(),
QMessageBox::NoIcon,
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton,
this
);
credits.exec();
file.close();
}
To copy to clipboard, switch view to plain text mode
Bookmarks