Review Request: Make KModifierKeyInfoProvider inherit QObject, rather than QWidget

David Faure faure at kde.org
Thu Aug 9 12:18:29 BST 2012



> On Aug. 8, 2012, 1:08 p.m., Aurélien Gâteau wrote:
> > The reason it was not applied is probably because I forgot to submit it :) Thanks for taking care of doing it.
> > 
> > If I am not mistaken the reason KModifierKeyInfoProvider inherits from QWidget is historical: it used to be necessary to inherit from QWidget to be able to setup an XEvent filter, but it is no longer the case.

Correct. KApplication was calling the QWidget::x11Event(XEvent*) virtual in the 'event filter object', so it had to be a QWidget. Obviously this code has been ported to the qt-4.8 native-event-filter instead, so no inheritance necessary for event filtering, a QObject will do for the signals. (With Qt5 I changed that API again, it will have to inherit from QAbstractNativeEventFilter too, I'll take care of that.)


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/105920/#review17101
-----------------------------------------------------------


On Aug. 7, 2012, 9:21 p.m., Frank Reininghaus wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/105920/
> -----------------------------------------------------------
> 
> (Updated Aug. 7, 2012, 9:21 p.m.)
> 
> 
> Review request for kdelibs, Michael Leupold and Aurélien Gâteau.
> 
> 
> Description
> -------
> 
> The base class of KModifierKeyInfoProvider is QWidget although it seems that this class does not really need anything that QWidget provides and QObject doesn't.
> 
> This seems to be related to Dolphin crashes that can happen with some styles and some particular settings, see also https://bugs.kde.org/show_bug.cgi?id=264923.
> 
> According to https://bugs.kde.org/show_bug.cgi?id=264923#c11, Aurelien wrote the patch which I'm uploading here. Is there any information on why KModifierKeyInfoProvider was derived from QWidget in the first place, or why Aurelien's patch never made it into kdelibs?
> 
> The root cause of the crash is probably something else, but having a class inherit QWidget rather than QObject when it's not actually needed looks strange to me in any case. Unless there's a good reason that I'm overlooking here, of course - in that case, I'm curious what it is :-)
> 
> 
> This addresses bug 303169.
>     http://bugs.kde.org/show_bug.cgi?id=303169
> 
> 
> Diffs
> -----
> 
>   kdeui/util/kmodifierkeyinfoprovider_p.h 2df79bc 
>   kdeui/util/kmodifierkeyinfoprovider_x11.cpp c6477f9 
> 
> Diff: http://git.reviewboard.kde.org/r/105920/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Frank Reininghaus
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20120809/144842ba/attachment.htm>


More information about the kde-core-devel mailing list