I implemented a custom QMessageBox, inherited from QDialog. (Using qt 4.8.6)
The problem is now that all the custom messageboxes look totally different from the QMessageBox static functions:
- QMessageBox::information(...)
- QMessageBox::critical(...)
- QMessageBox::question(...)
- QMessageBox::warning(...)
They differ in size, font, fontsize, icons, background (the static qmessageboxs have two background colors), etc, ... .
The only thing i found was how to access the operation system specific messagebox icons.
QStyle *style = QApplication::style();
QIcon tmpIcon = style->standardIcon(QStyle::SP_MessageBoxInformation, 0, this);//for QMessageBox::Information
Is there something similar for the font or the whole style.
I know QMessagebox uses operation system specific styleguides. But i can not find them. You can view the source here.
So my question is how to make a custom QMessageBox, inherited from QDialog look like the static QMessageBox::... functions?
(If i could access the QMessageBox object, created in this static function calls i could read out all the style and font parameters. But this is not possible.)