qskAncestorOf -> qskFindAncestorOf
This commit is contained in:
parent
319ad18fd6
commit
53f3dc519d
|
@ -44,12 +44,12 @@ QSK_EXPORT void qskInputMethodSetVisible( const QQuickItem*, bool );
|
||||||
QSK_EXPORT const QSGNode* qskItemNode( const QQuickItem* );
|
QSK_EXPORT const QSGNode* qskItemNode( const QQuickItem* );
|
||||||
QSK_EXPORT const QSGNode* qskPaintNode( const QQuickItem* );
|
QSK_EXPORT const QSGNode* qskPaintNode( const QQuickItem* );
|
||||||
|
|
||||||
template< typename Item >
|
template< typename T >
|
||||||
inline Item qskAncestorOf( const QQuickItem* item )
|
inline T qskFindAncestorOf( const QQuickItem* item )
|
||||||
{
|
{
|
||||||
for ( auto it = item; it != nullptr; it = it->parentItem() )
|
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;
|
return ancestor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue