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

Widget with WA_PaintOnScreen set on never got paintEvent called.

    XMLWordPrintable

Details

    Description

      Here is part of the code from QtMultimedia VideoWidget example:

      VideoWidget::VideoWidget(QWidget *parent)
          : QWidget(parent)
          , surface(0)
      {
          setAutoFillBackground(false);
          setAttribute(Qt::WA_NoSystemBackground, true);
          setAttribute(Qt::WA_PaintOnScreen, true);
      
          QPalette palette = this->palette();
          palette.setColor(QPalette::Background, Qt::black);
          setPalette(palette);
      
          setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
      
          surface = new VideoWidgetSurface(this);
      }
      void VideoWidget::paintEvent(QPaintEvent *event)
      {
          QPainter painter(this);
      
          ...
      }
      

      When WA_PaintOnScreen is set to true, the paintEvent never gets called, in which way it is not suppose to happen. If unset it, the paintEvent gets called.

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              bigbearzhu Jun Zhu
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes