[PyQt] QMessage box question...

Laurent Dufrechou laurent.dufrechou at free.fr
Fri Oct 16 22:05:04 BST 2009


Hi,

I have a QMessageBox which have small text and informative text, but
have big lines as detailed text. (kind of exeption log)
Thus, my dialog is quite small and when the user shows the details,
this
is almost unreadable.

My current code:

def MessageBox(title, text, info, detail, info_icon, buttons, default =
None):
    msg_box = QMessageBox()
    msg_box.setWindowTitle(title)
    icon = QIcon()
    icon.addPixmap(QPixmap(":/icons/Ressources/my.ico"),
                   QIcon.Normal, QIcon.Off)
    msg_box.setWindowIcon(icon)
    msg_box.setText(text)
    msg_box.setInformativeText(info)
    if detail != "":
        msg_box.setDetailedText(detail)
    msg_box.setIcon(info_icon)
    msg_box.setStandardButtons(buttons)
    if default is not None:
        msg_box.setDefaultButton(default)

window = MessageBox("Application Error","An unhandled exception has
occured.",
                    "ddddddddddddddd\n",

("ttttttttttttttttttttttttttttttttttttttttttttttttt"*10+"\n")*100,
                    QMessageBox.Critical, QMessageBox.Ignore)


Detailed info are almost unreadable :(

Any direction appreciated!
Laurent



More information about the PyQt mailing list