I think, that I wouldn't help you yet, but...
I tried your code with Qt 4.6.2 at Windows 7 and Visual Studio 2008 ( all of them are not your case
)
in Release version of program i had:
213 ms
160 ms
172 ms
162 ms
162 ms
162 ms
162 ms
179 ms
162 ms
175 ms
161 ms
213 ms
160 ms
172 ms
162 ms
162 ms
162 ms
162 ms
179 ms
162 ms
175 ms
161 ms
To copy to clipboard, switch view to plain text mode
P.S. my picture is 80x80 JPEG
{
t.start();
// You can change the file name if you need
QPixmap pixmap
( "d:\\Pictures\\shrek_3_-_cat_avatar__80.jpg" );
brush.setColor( Qt::red );
//painter.end();
//painter.begin(this);
painter.setBrush( brush );
for (int j=0; j<100; j++) {
for (int i=0; i<10; i++) {
rect.setRect( i*100, 0, 100, 1000 );
painter.drawRect( rect );
}
}
painter.end();
qDebug() << t.elapsed();
}
void tst::paintEvent( QPaintEvent * )
{
QTime t;
t.start();
// You can change the file name if you need
QPixmap pixmap( "d:\\Pictures\\shrek_3_-_cat_avatar__80.jpg" );
QBrush brush( pixmap );
brush.setColor( Qt::red );
QPainter painter( this );
//painter.end();
//painter.begin(this);
painter.setBrush( brush );
QRect rect;
for (int j=0; j<100; j++) {
for (int i=0; i<10; i++) {
rect.setRect( i*100, 0, 100, 1000 );
painter.drawRect( rect );
}
}
painter.end();
qDebug() << t.elapsed();
}
To copy to clipboard, switch view to plain text mode
Bookmarks