QMessageBox
uses a QGridLayout
. So, you can add your QProgressBar
to its layout:
msgBox = QMessageBox( QMessageBox.Warning, "My title", "My text.", QMessageBox.NoButton )
# Get the layout
l = msgBox.layout()
# Hide the default button
l.itemAtPosition( l.rowCount() - 1, 0 ).widget().hide()
progress = QProgressBar()
# Add the progress bar at the bottom (last row + 1) and first column with column span
l.addWidget(progress,l.rowCount(), 0, 1, l.columnCount(), Qt.AlignCenter )
msgBox.show()
You can also remove the buttons msgBox.setStandardButtons( QMessageBox.NoButton )
. But the close button will be disabled, too...