I've been using a QMessageBox
to display the outcome of a statistical test. It's nice, because I can put a summary result in the informative text, then the full result in the detailed text. The trouble is, the full result is a table, so I'd like it to be monospaced so that it looks right, and QMessageBox
doesn't use a monospace font in the detailed text area.
So I'm looking at either subclassing QMessageBox
, or subclassing QDialog
to make something that looks like a QMessageBox
but uses a monospace font in the detailed text area. I'm a bit rusty at the moment, and having a hard time figuring out which is the better option. Could I subclass QMessageBox
, just add my own QTextEdit
and my own "show detailed text" button, and leave the QMessageBox
detailed text area and button hidden? Or is there some easier way to do this?
You can use html text in the fields of a QMessageBox, that would be the easiest way. As a hint, try putting
<pre>Test</pre>
in your QString.
Any other customization of the message box will probably imply a subclass, though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With