I am trying to build a message dialog that shows the details of impacts to my UI. This list is long enough that a scroll bar is needed but the text is long enough that I would prefer the lines to not be broken. Seems changign the size of QMessage dialog box is hard since it caluates it on its contents. Is there a way to "encourage that detailed box to prevent line breaks?
Alternatively allow resizing of the QMessageBox
impacts = []
# Create Impacts
for i in range(0, 100):
impacts.append(" This is a text can be a little long but not too long impact {}".format(i))
# CreateDialog
diffBox = QMessageBox()
diffBox.setWindowTitle("Test")
diffBox.setInformativeText(
"Impacts have been found, and this message is long but not too long as well but independent of the list")
diffBox.setDetailedText("changes:\n\n" + "\n".join(impacts))
# Add Buttons
diffBox.addButton("Apply", QMessageBox.AcceptRole)
diffBox.setStandardButtons(QMessageBox.Cancel)
diffBox.setSizeGripEnabled(True)
result = diffBox.exec_()