Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
-
Windows (Windows 7), Mac (OSX 10.7)
-
b3820b12fbded1f173837eee7f7559783e92b46b , fixup 67bed5616bf4743b432566130d1f3cfb6a2dc0c1, yet another fix: bc741b867cbff58f59c2698d22a37121ebcc6c50
Description
With Qt5, a frameless window with opacity animation turns black at the end of animation. To make it refresh/update, you need to move your mouse over buttons. This issue only happens with Qt5.
#include <QApplication> #include <QPushButton> #include <QHBoxLayout> #include <QPropertyAnimation> int main(int argc, char *argv[]) { QApplication a(argc, argv); // Create transparent popup window. QWidget* popup = new QWidget(NULL, Qt::WindowFlags(Qt::FramelessWindowHint | Qt::ToolTip)); popup->setWindowFlags(Qt::FramelessWindowHint | Qt::ToolTip); popup->setAttribute(Qt::WA_TranslucentBackground); // Add button to popup window. QHBoxLayout* layout = new QHBoxLayout(popup); QPushButton* button1 = new QPushButton(popup); button1->setFixedSize(200, 300); layout->addWidget(button1); QPushButton* button2 = new QPushButton(popup); button2->setFixedSize(200, 300); layout->addWidget(button2); // Create opacity animation. QPropertyAnimation* fadeInAnimation = new QPropertyAnimation(popup, "windowOpacity"); fadeInAnimation->setDuration(1000); fadeInAnimation->setStartValue(0.0); fadeInAnimation->setEndValue(1.0); // Show popup popup->setWindowOpacity(0.0); fadeInAnimation->start(); popup->show(); return a.exec(); }
Attachments
Issue Links
- relates to
-
QTBUG-29100 Alpha channel accumulating
- Closed
-
QTBUG-28531 WA_TranslucentBackground widget issues
- Closed
-
QTBUG-33025 Windows: Animating window opacity does not work if FramelessWindowHint is set for non-translucent windows.
- Closed