I'm working on a custom styled QMessageBox. In my custom QStyle class in method polish() I call:
if( (pDialog = qobject_cast<QDialog*>( pWidget )) != NULL )
{
pDialog->setWindowFlags( pDialog->windowFlags() | Qt::FramelessWindowHint );
// Allow QStyle draw widget background
pDialog->setAttribute( Qt::WA_StyledBackground, true );
// Set window background transparent
QPalette oPalette = pDialog->palette();
oPalette.setBrush( QPalette::Window, QBrush(Qt::transparent) );
pDialog->setPalette( oPalette );
}
This works fine, unless we use a semi-transparent border: The semi-transparent part gets darker and darker on every repaint (e.g. when pressing "Show Details"/"Hide Details" many times).
UPDATE: I just realized, that when moving the message box the "too-dark semi-transparent content" is moved too. Thus I want to flush the QWidget painting-cache - if something like this exists (backing-store??).