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

QWidget:paintEvent is received by inactive windows

    XMLWordPrintable

Details

    Description

      This was reproduced on X11 and Windows XP as well as embedded Linux using qvfb -qws and tested with Qt 4.5.1 and Qt 4.4.3

      To reproduce, a gzipped tar archive is attached to the message from support.This is just a small app that reimplements event() to catch events and test for the following condition:-

      is the window active?
      if so, is it receiving paint events?

      The output is displayed in the application output.

      Or use a method like this in any QWidget or QWidget derived class:-

      bool MainWindow::event(QEvent* event)
      {
      if(this->isActiveWindow())

      { pFlag = true; if(event->type() == QEvent::Paint ) qDebug() << "Paint event while main window active"; }

      else

      { pFlag = false; }

      if(event->type() == QEvent::Paint)
      {

      if(!this->isActiveWindow())

      { if(pFlag == false) qDebug() << "Paint Event on inactive window before window has been active"; }

      }

      return QMainWindow::event( event );
      }

      The problem occurs in Qt 4.5.x but is absent in Qt 4.4.3

      This affects performance and causes flicker, particularly noticeable on embedded devices.

      Attachments

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

        Activity

          People

            sletta Gunnar Sletta
            cattell Matthew Cattell (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes