qskinny/src/controls/QskQuick.h

69 lines
2.2 KiB
C
Raw Normal View History

2018-05-01 12:26:59 +02:00
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the QSkinny License, Version 1.0
*****************************************************************************/
#ifndef QSK_QUICK_H
#define QSK_QUICK_H 1
#include "QskGlobal.h"
2018-07-19 14:10:48 +02:00
#include <qnamespace.h>
2019-03-15 15:39:27 +01:00
#include <qquickitem.h>
2018-07-19 14:10:48 +02:00
class QQuickItem;
class QSGNode;
class QRectF;
2019-01-04 13:42:16 +01:00
template< typename T > class QList;
2018-05-01 12:26:59 +02:00
/*
Exporting methods from QQuickItemPrivate, that should be part
of QQuickItem.
*/
2019-01-04 13:42:16 +01:00
QSK_EXPORT bool qskIsItemComplete( const QQuickItem* );
2018-05-01 12:26:59 +02:00
QSK_EXPORT bool qskIsAncestorOf( const QQuickItem* item, const QQuickItem* child );
QSK_EXPORT bool qskIsTabFence( const QQuickItem* );
QSK_EXPORT bool qskIsShortcutScope( const QQuickItem* );
2018-06-26 11:10:44 +02:00
QSK_EXPORT bool qskIsVisibleTo( const QQuickItem* item, const QQuickItem* ancestor );
2018-10-23 19:18:05 +02:00
QSK_EXPORT bool qskIsVisibleToParent( const QQuickItem* );
2018-05-01 12:26:59 +02:00
2019-05-12 12:18:41 +02:00
QSK_EXPORT void qskSetTransparentForPositioner( QQuickItem*, bool );
QSK_EXPORT bool qskIsTransparentForPositioner( const QQuickItem* );
2018-05-01 12:26:59 +02:00
QSK_EXPORT QRectF qskItemRect( const QQuickItem* );
QSK_EXPORT QRectF qskItemGeometry( const QQuickItem* );
QSK_EXPORT void qskSetItemGeometry( QQuickItem*, const QRectF& );
QSK_EXPORT QQuickItem* qskNearestFocusScope( const QQuickItem* );
QSK_EXPORT void qskForceActiveFocus( QQuickItem*, Qt::FocusReason );
QSK_EXPORT QList< QQuickItem* > qskPaintOrderChildItems( const QQuickItem* );
QSK_EXPORT void qskUpdateInputMethod( const QQuickItem*, Qt::InputMethodQueries );
QSK_EXPORT void qskInputMethodSetVisible( const QQuickItem*, bool );
2018-05-01 12:26:59 +02:00
QSK_EXPORT const QSGNode* qskItemNode( const QQuickItem* );
QSK_EXPORT const QSGNode* qskPaintNode( const QQuickItem* );
2019-03-16 16:11:27 +01:00
template< typename T >
inline T qskFindAncestorOf( QQuickItem* item )
2019-03-15 15:39:27 +01:00
{
for ( auto it = item; it != nullptr; it = it->parentItem() )
{
2019-03-16 16:11:27 +01:00
if ( auto ancestor = qobject_cast< T >( it ) )
2019-03-15 15:39:27 +01:00
return ancestor;
}
return nullptr;
}
template< typename T >
inline T qskFindAncestorOf( const QQuickItem* item )
{
return qskFindAncestorOf< std::remove_const< T > >(
const_cast< QQuickItem * >( item ) );
}
2018-05-01 12:26:59 +02:00
#endif