Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.2.1
-
None
-
Qt 5.2.1, MacOSX 10.9.2
Description
Widget with WA_TranslucentBackground flag don't repaint background properly.
I created test application that contains QWidegt with setAttribute( Qt::WA_TranslucentBackground, true); and QLabel as a child. QPropertyAnimation animates QLabel position from TopLeft corner of QWidget to bottomRight corner.
TransWidget::TransWidget(QWidget *parent) : QWidget(parent), ui(new Ui::TransWidget) { ui->setupUi(this); resize( 400, 400); move( QPoint(100, 100)); setWindowFlags( Qt::FramelessWindowHint); setAttribute( Qt::WA_TranslucentBackground, true); setAutoFillBackground( false); QLabel *l = new QLabel( this); l->setText( "Example text"); l->setAutoFillBackground( false); QPropertyAnimation *a = new QPropertyAnimation(l, "geometry"); a->setDuration( 10000); a->setStartValue( l->rect()); QRect eRect; eRect = l->rect(); eRect.moveTopLeft( this->rect().bottomRight()); a->setEndValue( eRect); a->start(); }
Expected result (and achivable on i.e. Win8 with Qt 5.2.1)
QLabel (with text "Example text" will animate from top left corner to bottom right corner of parent widget with translucent background) and on screen I got correct result on WIndows:
And on MacOSX, with translucent background:
and macOSX without translucent background:
And what resolves that issue is setting in paintEvent:
QPainter p( this ); p.setCompositionMode( QPainter::CompositionMode_Clear ); p.fillRect( this->rect(), Qt::transparent );
Attachments
Issue Links
- replaces
-
QTBUG-50728 Qt repaint issue for for translucent background on Mac, ghost image stays back
- Closed