Version: unspecified (using KDE 4.3.5) OS: Linux When loading a png file to a QPixmap and let a QPainter draw this pixmap, the png graphic does not show up when "Oxygen" style is selected via qtconfig. When selecting a different style like "Plastique", the Pixmap is immediately rendered correctly. Reproducible: Always Steps to Reproduce: QPixmap background(QPixmap("example.png")); QPainter painter; painter.drawPixmap(background); Actual Results: When selecting "Oxygen" as theme in qtconfig, a grey square is displayed instead of the exmaple.png. When selecting any other style, the png is displayed. Expected Results: png should be drawn also when oxygen style is selected. Qt is 4.6.3
Please attach a complete test case. The code fragment above does not state where the painter paints to.
As noted by Christophe, without the full chunk of code, there is nothing I can do about it. Some png are painted just fine (e.g: icons in toolbars). Now some widgets have their "paintEvent" method bypassed by oxygen, and that would likely create the issue you mention, though browsing through the code, the only case where that seems to be a problem is for QToolBars, when detached.
I can confirm this problem. The background pixmap of my widget becomes dark in oxygen style, while fine in plastique style. example source run as ./myapp -style oxygen run as ./myapp -style plastique You will see the difference. =================================================== #include <QtGui/QApplication> #include <QtGui/QPalette> #include <QtGui/QPixmap> #include <QtGui/QWidget> int main( int argc, char* argv[] ) { QApplication app( argc, argv ); QWidget w; w.setAutoFillBackground( true ); QPalette p( w.palette() ); p.setBrush( QPalette::Window, QBrush( QPixmap( "example.png" ) ) ); w.setPalette( p ); w.show(); return app.exec(); }
My system info Qt 4.7.2 KDE 4.6.2 Chakra Linux
yes indeed the palette "brush" is ignored by oxygen when rendering widgets background (and you get the background gradient instead). I'll see to test on it and fix.
Git commit 573289f1dffbceeaaf1a5e189c075cd84cae17f3 by Hugo Pereira Da Costa. Committed on 17/04/2011 at 16:15. Pushed by hpereiradacosta into branch 'master'. Do not render window background in case a custom texture is attached to a palette. CCBUG: 242271 M +8 -1 kstyles/oxygen/oxygenstyle.cpp http://commits.kde.org/kde-workspace/573289f1dffbceeaaf1a5e189c075cd84cae17f3
Git commit e7821f530cc506843523e6b846ba1095cea54513 by Hugo Pereira Da Costa. Committed on 17/04/2011 at 16:15. Pushed by hpereiradacosta into branch 'KDE/4.6'. Do not render window background in case a custom texture is attached to a palette. CCBUG: 242271 M +8 -1 kstyles/oxygen/oxygenstyle.cpp http://commits.kde.org/kde-workspace/e7821f530cc506843523e6b846ba1095cea54513
Fixed I think. So closing.