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

Qt::FramelessWindowHint with opacity on QMainWindow/QDialog does not give correct mouse enter/leave event.

    XMLWordPrintable

Details

    Description

      The problem is that the window transparency behaves randomly and not consistent when the mouse enters/leaves the main window area.
      Partial code snippets shown as below. Please see framelesswindowtest_v1.zip for the full test program.

      setWindowFlags(Qt::FramelessWindowHint);
      ...
      ...
      ...
      void DraftMainWindow::enterEvent(QEvent* event)
      {
          setWindowOpacity(1.0);
          qDebug() << "Mouse enter event." << draftElapsedTimer.elapsed();
          QWidget::enterEvent(event);
      }
      
      void DraftMainWindow::leaveEvent(QEvent* event)
      {
          setWindowOpacity(0.3);
          qDebug() << "Mouse leave event." << draftElapsedTimer.elapsed();
          QWidget::leaveEvent(event);
      }
      

      The issue cannot be reproducible with Qt 4.8.5 environment. Thus, it is likely a regression.

      Attachments

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

        Activity

          People

            peppe Giuseppe D'Angelo
            leonlee Leonard Lee
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes