I have created a QMessageBox as follows:
msg_box = QtGui.QMessageBox()
msg_box.setSizeGripEnabled(True)
msg_box.setIcon( QtGui.QMessageBox.Information )
msg_box.setText('The following files are not .jpg ')
msg_box.setInformativeText('No. of Items : {0}'.format(len(contents)))
msg_box.setDetailedText('{0}'.format('\n'.join([str(sel) for sel in img_sels])))
msg_box.setStandardButtons(QtGui.QMessageBox.Cancel)
msg_exec = msg_box.exec_()
User will select a handful of images, and if within the selections, if it consists of items that are not of jpeg/ .jpg format, these items' file path will be collated and be displayed in QMessageBox
One issue that I had is that, I am having difficulties in getting the QMessageBox to be resize or have the UI width conform according the the length or the text etc. As I am unable to do that, the popup ui displays the filepath almost like in a wrapped text format, somewhat unsightly.
Is there any other ways that I can do to improve the code and have it accommodate to the width etc? If not, is there another QtGui command that I can consider to use it?