[Development] Qt 5.4.0 header diff: QtWidgets.diff

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Wed Nov 19 09:46:34 CET 2014

Il 19/11/2014 09:35, Thiago Macieira ha scritto:
> On Wednesday 19 November 2014 09:22:46 Giuseppe D'Angelo wrote:
>> Was adding a new override in the middle of an hierarchy safe? Or
>> subclasses in user code will now require a recompilation? (Not a big
>> deal, I don't expect that many QRubberBand subclasses with a timerEvent
>> override...)
> Overriding a virtual from the primary base is safe, provided that it's ok for
> derived classes to bypass the new override and instead call the base class's
> implementation. This is independent of whether the user overrode timerEvent
> again or not.
> This applies to the class, not to the user of the class. If the derived class
> is not recompiled, the it's like the new override is not there, regardless of
> who's using the derived class. If it is recompiled, then the new virtual is
> used, regardless of who created the object.
> PS: all new virtual overrides should be Q_DECL_OVERRIDE.

And now this feels wrong, right? The typical implementation of 
timerEvent is something like:

 > if (e->timerId() == myTimerId) doSomething();
 > else BaseClass::timerEvent(e);

But this bypasses QRubberBand's own timer logic unless the subclass gets 

Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel. UK +44-1738-450410, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4048 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/development/attachments/20141119/38267d8a/attachment.bin>

More information about the Development mailing list