[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-cygwin
Subject:    RE: [PATCH]Mouse-over effects don't work properly in QToolBox
From:       REGAT-BARREL Aurelien <arbvtk () yahoo ! fr>
Date:       2004-12-17 0:34:24
Message-ID: 20041217003424.41068.qmail () web25210 ! mail ! ukl ! yahoo ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,
I spent lots of time tracing execution with the debuger, and I didn't find a place in \
*win.cpp code which seems to be responsible. The point of my interest is now \
qbutton.cpp, in paintEvent function (line 880) : /*!
    Handles paint events for buttons. Small and typically complex
    buttons are painted double-buffered to reduce flicker. The
    actually drawing is done in the virtual functions drawButton() and
    drawButtonLabel().
    \sa drawButton(), drawButtonLabel()
*/
void QButton::paintEvent( QPaintEvent *)
{
#ifdef Q_WS_WIN
    QPainter p( this );
    drawButton (&p);
#else
    QSharedDoubleBuffer buffer( this );
    drawButton( buffer.painter() );
#endif 
}
 
I tried to change the #ifdef in order to use the double buffering as the comments \
suggest, and... it works! In fact, clearing the QPainter is missing, the following \
code works too:  
#ifdef Q_WS_WIN
    QPainter p( this );
    p.eraseRect( this->rect() );    <- added
    drawButton (&p);
#else

So I looked in qbutton.cpp from qt-x11-free-3.3.3 and found this:
 
void QButton::paintEvent( QPaintEvent *)
{
    QSharedDoubleBuffer buffer( this );
    drawButton( buffer.painter() );
}

So I am wondering where does this #ifdef Q_WS_WIN comes from ? What do you think \
about using the double buffer which is what is used in last Qt X11 release ?  
Regards.


Aurelien REGAT-BARREL 




		
---------------------------------
 Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
Créez votre Yahoo! Mail


[Attachment #5 (text/html)]

<DIV>Hi,</DIV>
<DIV>I spent lots of time tracing execution with the debuger, and I didn't find a \
place in *win.cpp code which seems to be responsible. The point of my interest is now \
qbutton.cpp, in paintEvent function (line 880)&nbsp;:</DIV> \
<DIV>/*!<BR>&nbsp;&nbsp;&nbsp; Handles paint events for buttons. Small and typically \
complex<BR>&nbsp;&nbsp;&nbsp; buttons are painted double-buffered to reduce flicker. \
The<BR>&nbsp;&nbsp;&nbsp; actually drawing is done in the virtual functions \
drawButton() and<BR>&nbsp;&nbsp;&nbsp; drawButtonLabel().</DIV> \
<DIV>&nbsp;&nbsp;&nbsp; \sa drawButton(), drawButtonLabel()<BR>*/<BR>void \
QButton::paintEvent( QPaintEvent *)<BR>{<BR>#ifdef Q_WS_WIN<BR>&nbsp;&nbsp;&nbsp; \
QPainter p( this );<BR>&nbsp;&nbsp;&nbsp; drawButton \
(&amp;p);<BR>#else<BR>&nbsp;&nbsp;&nbsp; QSharedDoubleBuffer buffer( this \
);<BR>&nbsp;&nbsp;&nbsp; drawButton( buffer.painter() );<BR>#endif <BR>}</DIV> \
<DIV>&nbsp;</DIV> <DIV>I tried to change the #ifdef in order to use the double \
buffering as the comments suggest, and... it works! In fact, clearing the QPainter is \
missing, the following code works too:</DIV> <DIV>&nbsp;</DIV>
<DIV>#ifdef Q_WS_WIN<BR>&nbsp;&nbsp;&nbsp; QPainter p( this );<BR>&nbsp;&nbsp;&nbsp; \
p.eraseRect( this-&gt;rect() );&nbsp;&nbsp;&nbsp; &lt;- added<BR>&nbsp;&nbsp;&nbsp; \
drawButton (&amp;p);<BR>#else<BR></DIV> <DIV>So I looked in qbutton.cpp from \
qt-x11-free-3.3.3 and found this:</DIV> <DIV>&nbsp;</DIV>
<DIV>void QButton::paintEvent( QPaintEvent *)<BR>{<BR>&nbsp;&nbsp;&nbsp; \
QSharedDoubleBuffer buffer( this );<BR>&nbsp;&nbsp;&nbsp; drawButton( \
buffer.painter() );<BR>}<BR></DIV> <DIV>So I am wondering where does this #ifdef \
Q_WS_WIN comes from ? What do you think about using the double buffer which is what \
is used in last Qt X11 release ?</DIV> <DIV>&nbsp;</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://f \
r.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>



_______________________________________________
kde-cygwin mailing list
kde-cygwin@kde.org
https://mail.kde.org/mailman/listinfo/kde-cygwin


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic