I'm completely new with QT and find it quite confusing.
I created a QListView (called "listview") and would like to show that in my QMessageBox:
const int resultInfo = QMessageBox::information(this, tr("Generate Software"),
tr("The following files will be changed by the program:"),
=> Here the QListView should show up!
QMessageBox::Yes | QMessageBox::No);
if (resultInfo != QMessageBox::Yes) {
return;
}
Is that possible somehow?
QMessageBox
is designed to serve texts and buttons only. See link.If you just want to have a "More details" text, try using detail text property. In that case, you will have to create the message box using its constructor and set the icons, texts explicitly, not using the convenient
information()
function.If you still want to have a list view in the message box, you should consider using
QDialog
, which is the base class ofQMessageBox
. Small example below: