PDA

View Full Version : QScrollBar within a QMessageBox



schall_l
13th April 2010, 12:18
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");

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();
}

zgulser
13th April 2010, 14:37
I guess detailedText property of QMessageBox will help you to perform what you want..?