Fixed warning when rendering text on invalid rectangle;

Fixed painting of buttons in preview.
(thanks Martin :) )
This commit is contained in:
Hugo Pereira Da Costa 2012-02-29 17:10:23 +01:00
parent b7ba859dd6
commit 2eb4b96a8c

View file

@ -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<Button*> buttons( widget()->findChildren<Button*>() );
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();
}
}