Use QPainter to render preview

Reviewed by Lucas Murray
BUG: 203842

svn path=/trunk/KDE/kdebase/workspace/; revision=1015361
This commit is contained in:
Christoph Feck 2009-08-25 11:13:27 +00:00
parent 399787aa30
commit a83e508bdd

View file

@ -25,7 +25,7 @@
#include <kglobal.h>
#include <QLabel>
#include <QStyle>
//Added by qt3to4:
#include <QPainter>
#include <QMouseEvent>
#include <QResizeEvent>
#include <QVector>
@ -108,11 +108,21 @@ void KDecorationPreview::disablePreview()
}
void KDecorationPreview::paintEvent( QPaintEvent* e )
{
QWidget::paintEvent(e);
if( deco[Inactive] ) deco[Inactive]->widget()->render( this, deco[Inactive]->widget()->mapToParent( QPoint(0,0) ) );
if( deco[Active] ) deco[Active]->widget()->render( this, deco[Active]->widget()->mapToParent( QPoint(0,0) ) );
}
{
QPainter painter( this );
QPoint delta = mapTo( window(), QPoint(0, 0) );
if ( deco[Inactive] )
{
QWidget *w = deco[Inactive]->widget();
w->render( &painter, delta + w->mapToParent( QPoint(0, 0) ) );
}
if ( deco[Active] )
{
QWidget *w = deco[Active]->widget();
w->render( &painter, delta + w->mapToParent( QPoint(0, 0) ) );
}
}
void KDecorationPreview::resizeEvent( QResizeEvent* e )
{