From 2eb4b96a8ccb9a41303c0f698f6fcd9c2c6476a0 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Wed, 29 Feb 2012 17:10:23 +0100 Subject: [PATCH] Fixed warning when rendering text on invalid rectangle; Fixed painting of buttons in preview. (thanks Martin :) ) --- clients/oxygen/oxygenclient.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index 34c58e111f..17832ecc9d 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -978,6 +978,8 @@ namespace Oxygen { QPixmap out( rect.size() ); + if( !rect.isValid() ) return QPixmap(); + out.fill( Qt::transparent ); if( caption.isEmpty() || !color.isValid() ) return out; @@ -1439,13 +1441,15 @@ namespace Oxygen QList buttons( widget()->findChildren() ); foreach( Button* button, buttons ) { - if( button->isVisible() && event->rect().intersects( button->geometry() ) ) + if( ( button->isVisible() || isPreview() ) && event->rect().intersects( button->geometry() ) ) { + painter.save(); painter.setViewport( button->geometry() ); painter.setWindow( button->rect() ); button->paint( painter ); painter.restore(); + } }