qskAncestorOf -> qskFindAncestorOf

This commit is contained in:
Uwe Rathmann 2019-03-16 16:11:27 +01:00
parent 319ad18fd6
commit 53f3dc519d

View File

@ -44,12 +44,12 @@ QSK_EXPORT void qskInputMethodSetVisible( const QQuickItem*, bool );
QSK_EXPORT const QSGNode* qskItemNode( const QQuickItem* );
QSK_EXPORT const QSGNode* qskPaintNode( const QQuickItem* );
template< typename Item >
inline Item qskAncestorOf( const QQuickItem* item )
template< typename T >
inline T qskFindAncestorOf( const QQuickItem* item )
{
for ( auto it = item; it != nullptr; it = it->parentItem() )
{
if ( auto ancestor = qobject_cast< Item >( it ) )
if ( auto ancestor = qobject_cast< T >( it ) )
return ancestor;
}