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

Presence of QWebEngineView make widgets misbehave

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.6.2
    • 5.6.0
    • None
    • MSVC2015 64bits
      Windows 10 64bits
      Linux/gcc 64bits
      OS X
    • 00061b968d23d34cdbd43e0930463be06a2775b3

    Description

      Short story

      The presence of a QWebEngineView on screen seems to restore the graphic buffers of other widgets to a previous state.
      Qt 5.5.1 does not have this issue.

      Long story

      I have a QMainWindow with 3 buttons and a stack widget. The stack widget as 3 widgets and the first one of them contains a QWebEngineView.

      The 3 buttons are instances of MyButton which inherits QAsbtractbutton. They are checkable and are members of a QButtonGroup.
      The clicked() signal of each button is connected to a slot which calls setCurrentIndex(int) on the stack widget.
      I've managed to track paint events by drawing in the button a unique identifier.

      void MyButton::paintEvent(QPaintEvent *event)
      {
      	static int n = 0;
      	++n;
      
      	qDebug() << this << isChecked() << isDown() << n;
      	QPainter p(this);
      
      	if(isDown() || isChecked())
      	{
      		p.setPen(Qt::NoPen);
      		p.setBrush(QColor("#428bca"));
      		//p.setClipRect(event->rect());
      		p.drawRect(event->rect());
      
      		p.setPen(Qt::white);
      	}
      	else
      	{
      		p.setPen(QColor("#428bca"));
      	}
      	p.drawText(6, 28, text() + " " + QString::number(n));
      	p.end();
      }
      

      At runtime, when the application launches I can click ob the button 3 and the 3rd widget of the stack is displays. Then I press the left mouse button on the button 1 and I can see that the button 1 is repainted with a given value of n (let's say 30), the I release the mouse button, the clicked() signal is emitted and the stack displays the 1st widget (the one with a QWebEngineView. So far so good, but the buttons also get repainted with a lower version of n (let's say 25) even if in the debug output I can see calls to painEvent with higher n values.

      The attached zip is a sample that exhibits the problem.

      Attachments

        1. main.cpp
          3 kB
        2. qtbug52123.zip
          2 kB
        3. test_paint.zip
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            alexandru.croitor Alexandru Croitor
            bterrier Benjamin Terrier
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes