Hi,
I'm trying to set an icon to the buttons of the QMessageBox (StandardButton enum), not the icon of the QMessageBox (QMessageBox::icon() ).
In my aplication the QPushButtons has an icon established by QtDesigner.
I'd like not to inherentance the QMessageBox because I'd like to use the static functions QMessageBox::critical(...) and so on. There're vey useful and a quick way to popup any info.
I tried by stylesheet, I have a qss that I load at the aplicattion starts up.
My best tries, has been:
QMessageBox
{
dialog-cancel-icon: url../images/icons/Cerrar.png);
dialog-close-icon: url(../images/icons/Cerrar.png);
dialog-ok-icon: url(../images/icons/Ok.png);
dialog-yes-icon: url(../images/icons/Ok.png);
dialog-no-icon: url(../images/icons/Cerrar.png);
dialog-apply-icon: url(../images/icons/Ok.png);
dialog-reset-icon: url(../images/icons/Cerrar.png);
}
I've tried with "QDialog" instead of "QMessageBox", but nothing, no icon appear in the message box buttons.
The paths to the images are ok, because in another widgets works.
Is anyway to do this? How? Coding, stylesheets?
Thank you![]()
Bookmarks