[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-artists
Subject:    [kde-artists] Oxygen grandients prevent proper Qt internal tests
From:       Thiago Macieira <thiago.macieira () trolltech ! com>
Date:       2009-01-26 13:00:09
Message-ID: 200901261400.20217.thiago.macieira () trolltech ! com
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Hello Oxygen developers

For the past month, we've been seeing Qt tests failing on our KDE 4 machine 
and we hadn't been able to track down the problem. Until now.

It appears that Oxygen installs an event filter and hijacks the paint event to 
"mess up" the windows being drawn, by adding a gradient where there was none. 
Our tests then break because the rendering isn't what was expected. The 
following testcase is simple example of the problem:

    QWidget w;
    QPalette opaquePalette = w.palette();
    opaquePalette.setColor(w.backgroundRole(), Qt::red);
    w.setPalette(opaquePalette);
    w.setAutoFillBackground(true);

    w.setGeometry(10, 100, 50, 50);
    w.show();
    QApplication::processEvents();
    qt_x11_wait_for_window_manager(&w);

    QPixmap px = QPixmap::grabWindow(w.winId());
    px.save("redblock.xpm");

    QPixmap expectedPixmap(px);
    expectedPixmap.fill(Qt::red);

    QCOMPARE(px, expectedPixmap);

Is there any chance you can modify Oxygen to make the test above pass? We 
simply want a 50x50 opaque, solid red block, but instead we get a gradient. 
See the "redblock.xpm" saved file for more information.

I have tracked down the problem to kdebase/runtime/kstyles/oxygen/oxygen.cpp 
around line 3481:

            if(widget->testAttribute(Qt::WA_StyledBackground) && !widget-
>testAttribute(Qt::WA_NoSystemBackground))
            {
                QPainter p(widget);
                _helper.renderWindowBackground(&p, widget->rect(), 
widget,widget->window()->palette());
            }

If I remove this code, our tests pass as expected. An environment variable 
(OXYGEN_NO_GRADIENTS or OXYGEN_PAINT_AS_TOLD) would be enough.

If the test above isn't made to pass, we will have to ban Oxygen from our test 
machines, as well as request that any bug reports relating to painting issues 
be retried with Plastique.

-- 
Thiago Macieira - thiago.macieira (AT) nokia.com
  Senior Software Engineer - Nokia, Qt Software
  Qt Software is hiring - ask me
      Sandakerveien 116, NO-0402 Oslo, Norway

["signature.asc" (application/pgp-signature)]

______________________________________________________________________________
kde-artists@kde.org |  https://mail.kde.org/mailman/listinfo/kde-artists


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic