Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-33025

Windows: Animating window opacity does not work if FramelessWindowHint is set for non-translucent windows.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.2.0
    • 5.1.0 , 5.1.1
    • None
    • Windows 7
    • b7b573ad6d9f50ebff87f5c6204225366a1675bd

    Description

      With following code, opacity is not animated. Instead after timeout it is set visible. This works in 4.8.4. Attached is full example

      #include <QApplication>
      #include <QPropertyAnimation>
      #include <QMainWindow>
      #include <QPushButton>
      #include <QLabel>
      #include <QHBoxLayout>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          QWidget *mainWindow = new QWidget(0, Qt::WindowFlags(Qt::FramelessWindowHint));
      
          QHBoxLayout *l = new QHBoxLayout();
          QPushButton *b = new QPushButton("Quit");
          QObject::connect(b, SIGNAL(clicked()), qApp, SLOT(quit()));
          l->addWidget(b);
          l->addWidget(new QLabel(QT_VERSION_STR));
      
          mainWindow->setLayout(l);
          mainWindow->resize(QSize(500,500));
          QPropertyAnimation* fadeInAnimation = new QPropertyAnimation(mainWindow, "windowOpacity");
          fadeInAnimation->setDuration(1500);
          fadeInAnimation->setStartValue(0.0);
          fadeInAnimation->setEndValue(1.0);
          fadeInAnimation->start();
          mainWindow->show();
          return app.exec();
      }
      
      

      Attachments

        1. animate_opacity.zip
          1.0 kB
        2. qt4.log
          13 kB
        3. qt4transparency.log
          16 kB
        4. qtbug33025_4_diag.patch
          2 kB
        5. qtbug33025.zip
          2 kB

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kleint Friedemann Kleint
              qtcomsupport Qt Support
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes