[PATCH] Get rid of QPainter warnings

Fredrik Höglund fredrik at kde.org
Tue Apr 1 22:23:47 BST 2008


On Tuesday 01 April 2008 14:38, Andras Mantia wrote:
> Germain Garand wrote:
> > what kind of extraordinary question is that? what will happen if Qt 4.4
> > Beta 1 is released as is, is that your question?
> 
> Ok, I was probably not clear. But yes, I was asking what will happen if Qt
> comes out as it is now. Do we trust them, or we will try to solve the issue
> based on the Qt version that is available for us.
>  
> > You came in with a specific complain about a defective debug output in an
> > early Trolltech beta product.
> 
> First of all it annoyed me, as it pollutes the output when you want to debug
> KHTML (I wanted to debug an encoding related bug that I reported). Thiago
> told me that if the output appears, its either we use more than one painter
> at a time on the same paintdevice or Qt is buggy, but in that case we need
> a testcase. So I tried to see if indeed KHTML does something wrong or not.
> Meantime I thought that the debug output is related to the actual bugs I see
> on the webpages as they "looked" related. I hope it is clear now.

My analysis of those warnings is that they're related to the shared
painter optimization in Qt 4.4.  I think what happens is that when khtml
calls end() on the painter, Qt doesn't really end the painter, because
the painter is actually shared by the whole widget hierarchy.  When
khtml calls begin() again on the same device, Qt gets confused.

You'll see that if you set QT_NO_SHARED_PAINTER=1 before running
Konqueror, you no longer see those warnings.

Germain: It's occurred to me that the problem with embedding a QWidget
in a QGraphicsView is pretty much the same problem as with embedding
widgets in khtml.  In other words having the widgets respect the Z order
when they're fully or partially obscured by something that isn't a widget.
The main difference is that khtml doesn't need to be able to apply an
arbitrary perspective transformation matrix to the widget.

But I'm wondering if the khtml code can't be improved by taking advantage
of the infrastructure Trolltech has added to do this in QGraphicsView.
I'm not suggesting we turn khtml into a QGraphicsView, but rather use
the new widget attributes such as Qt::WA_DontShowOnScreen.

Regards,
Fredrik





More information about the kfm-devel mailing list