Fixed warning when rendering text on invalid rectangle;
Fixed painting of buttons in preview. (thanks Martin :) )
This commit is contained in:
parent
b7ba859dd6
commit
2eb4b96a8c
1 changed files with 5 additions and 1 deletions
|
@ -978,6 +978,8 @@ namespace Oxygen
|
||||||
{
|
{
|
||||||
|
|
||||||
QPixmap out( rect.size() );
|
QPixmap out( rect.size() );
|
||||||
|
if( !rect.isValid() ) return QPixmap();
|
||||||
|
|
||||||
out.fill( Qt::transparent );
|
out.fill( Qt::transparent );
|
||||||
if( caption.isEmpty() || !color.isValid() ) return out;
|
if( caption.isEmpty() || !color.isValid() ) return out;
|
||||||
|
|
||||||
|
@ -1439,13 +1441,15 @@ namespace Oxygen
|
||||||
QList<Button*> buttons( widget()->findChildren<Button*>() );
|
QList<Button*> buttons( widget()->findChildren<Button*>() );
|
||||||
foreach( Button* button, buttons )
|
foreach( Button* button, buttons )
|
||||||
{
|
{
|
||||||
if( button->isVisible() && event->rect().intersects( button->geometry() ) )
|
if( ( button->isVisible() || isPreview() ) && event->rect().intersects( button->geometry() ) )
|
||||||
{
|
{
|
||||||
|
|
||||||
painter.save();
|
painter.save();
|
||||||
painter.setViewport( button->geometry() );
|
painter.setViewport( button->geometry() );
|
||||||
painter.setWindow( button->rect() );
|
painter.setWindow( button->rect() );
|
||||||
button->paint( painter );
|
button->paint( painter );
|
||||||
painter.restore();
|
painter.restore();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue