patch: port KGlobal::findDirectChild to qt5 equivalent findDirect

David Faure faure+bluesystems at kde.org
Sun Jan 6 10:52:13 UTC 2013


On Saturday 05 January 2013 22:34:02 Jignesh Kakadiya wrote:
> Hi David,
> 
> I have ported all the calls which is in kparts. Please review it.

This performs a recursive search, which is slow and potentially wrong.

You didn't read the KGlobal documentation carefully enough :-)

     * @deprecated since Qt 5, use QObject::findChild(FindDirectChildrenOnly)

-> you need to pass the FindDirectChildrenOnly flag.
This flag only exists in Qt5 though, so you need to either wait for the Qt4 
support to be dropped (the current plan is to do that in 2 weeks), or to use 
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
qt5 code
#else
qt4 code
#endif

Thanks.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by BlueSystems and KDAB to work on KDE Frameworks



More information about the Kde-frameworks-devel mailing list