<DIV>Hi,</DIV>
<DIV>In file qwidget_win.cpp, in function</DIV>
<DIV> void QWidget::repaint( int x, int y, int w, int h, bool erase )</DIV>
<DIV>lines 1547-1548</DIV>
<DIV> QPaintEvent e( r, erase );<BR> if ( r != rect() )<BR> qt_set_paintevent_clipping( this, r );<BR> -> if ( erase )<BR> -> this->erase( x, y, w, h );<BR> QApplication::sendEvent( this, &e );<BR></DIV>
<DIV>If erasing is needed, it is done with erase(). I dont know where but it seems to be done a second time in response to the QPaintEvent raised. So I removed this 2 lines:</DIV>
<DIV> if ( erase )<BR> this->erase( x, y, w, h );<BR>and it removed the flickering I saw on the application I am testing. </DIV>
<DIV> </DIV>
<DIV>In file qapplication_win.cpp, lines 5653 & 5705, QWidget window class style is:</DIV>
<DIV> </DIV>
<DIV>wcx.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;</DIV>
<DIV> </DIV>
<DIV>I always hated CS_HREDRAW and CS_VREDRAW styles. They cause entire window redrawing => background erasing + redrawing, which causes flickering. I removed this 2 styles. But, if the window size grows, then painting is needed.</DIV>
<DIV>So I modified</DIV>
<DIV> QETWidget::translateConfigEvent</DIV>
<DIV>line 4831:</DIV>
<DIV> if ( isVisible() ) {<BR> QResizeEvent e( newSize, oldSize );<BR> QApplication::sendSpontaneousEvent( this, &e );<BR> <BR> -> this->repaint();<BR> } else {<BR> QResizeEvent * e = new QResizeEvent( newSize, oldSize );<BR> QApplication::postEvent( this, e );<BR> } <BR></DIV>
<DIV>I added the repaint() call.</DIV>
<DIV> </DIV>
<DIV>After that, there is less flickering. This is also true with the dirview example. But more testing is needed.</DIV>
<DIV>There is something strange : if you resize the window backwards / forwards horizontally OR vertically, it doesn't flicker. It you resize both horizontally and vertically (bottom right corner), it does. I think it is because the 2 resize events are not merged, but 2 events = 2 repaint() are received / called very shortly. I tried to batch the repaint() call with InvalidateRect / postEvent(), but it does nothing. But it is the same behaviour with Qt 2.3 NC. So, if the patch is approved, maybe the bug "[ 1060157 ] Unnecessary flicker during repaint" could be considered corrected.</DIV>
<DIV> </DIV>
<DIV>Here are the diff output from my local CVS copy:</DIV>
<DIV>-----------------------------------8<----------------------------------------------</DIV>
<DIV>diff -r1.1.2.30.2.23 qapplication_win.cpp<BR>4831a4832,4833<BR>> <BR>> this->repaint();<BR>4835c4837<BR>< }<BR>---<BR>> } <BR>5653c5655<BR>< wcx.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;<BR>---<BR>> wcx.style = CS_DBLCLKS; // | CS_HREDRAW | CS_VREDRAW;<BR>5705c5707<BR>< wcx.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;<BR>---<BR>> wcx.style = CS_DBLCLKS; // | CS_HREDRAW | CS_VREDRAW;</DIV>
<DIV>-----------------------------------8<----------------------------------------------</DIV>
<DIV>diff -r1.1.2.15.2.14 qwidget_win.cpp<BR>1547,1548c1547,1548<BR>< if ( erase )<BR>< this->erase( x, y, w, h );<BR>---<BR>> //if ( erase )<BR>> // this->erase( x, y, w, h );</DIV>
<DIV>-----------------------------------8<----------------------------------------------</DIV>
<DIV> </DIV>
<DIV>Regards.</DIV><BR><BR><DIV>
<DIV>
<DIV>Aurelien REGAT-BARREL <BR></DIV></DIV></DIV><p>
                <hr size=1>
Découvrez le nouveau Yahoo! Mail : <font color="red">250 Mo d'espace</font> de stockage pour vos mails !<br><a href="http://fr.rd.yahoo.com/mail/taglines/*http://fr.rd.yahoo.com/evt=25917/*http://fr.rd.yahoo.com/mail_fr/mail_campaigns/splash/taglines_250/default/*http://fr.promotions.yahoo.com/mail/creer28.html">Créez votre Yahoo! Mail</a><br><br>
Avec Yahoo! faites un don et soutenez le <a href="http://fr.rd.yahoo.com/mail/taglines/*http://fr.rd.yahoo.com/mail_fr/events/telethon2004/*http://www.telethon.fr/030-Don/10-10_Don.asp">Téléthon !</a>