10#include "QskPlacementPolicy.h"
12#include <qnamespace.h>
13#include <qquickitem.h>
18class QSGTransformNode;
23template<
typename T >
class QList;
29QSK_EXPORT QRhi* qskRenderingHardwareInterface(
const QQuickWindow* );
31QSK_EXPORT
bool qskIsItemInDestructor(
const QQuickItem* );
32QSK_EXPORT
bool qskIsItemComplete(
const QQuickItem* );
33QSK_EXPORT
bool qskIsAncestorOf(
const QQuickItem* item,
const QQuickItem* child );
34QSK_EXPORT
bool qskIsTabFence(
const QQuickItem* );
35QSK_EXPORT
bool qskIsShortcutScope(
const QQuickItem* );
36QSK_EXPORT
bool qskIsVisibleTo(
const QQuickItem* item,
const QQuickItem* ancestor );
37QSK_EXPORT
bool qskIsVisibleToParent(
const QQuickItem* );
38QSK_EXPORT
bool qskIsPolishScheduled(
const QQuickItem* );
40QSK_EXPORT
bool qskIsVisibleToLayout(
const QQuickItem* );
41QSK_EXPORT
bool qskIsAdjustableByLayout(
const QQuickItem* );
43QSK_EXPORT QSizeF qskEffectiveSizeHint(
const QQuickItem*,
44 Qt::SizeHint,
const QSizeF& constraint = QSizeF() );
46QSK_EXPORT QSizeF qskSizeConstraint(
const QQuickItem*,
47 Qt::SizeHint,
const QSizeF& constraint = QSizeF() );
49QSK_EXPORT QSizeF qskConstrainedItemSize(
const QQuickItem*,
const QSizeF& );
50QSK_EXPORT QRectF qskConstrainedItemRect(
51 const QQuickItem*,
const QRectF&, Qt::Alignment );
54QSK_EXPORT Qt::Alignment qskLayoutAlignmentHint(
const QQuickItem* );
61QSK_EXPORT QRectF qskItemRect(
const QQuickItem* );
63QSK_EXPORT QRectF qskItemGeometry(
const QQuickItem* );
64QSK_EXPORT
void qskSetItemGeometry( QQuickItem*,
const QRectF& );
66QSK_EXPORT QQuickItem* qskNearestFocusScope(
const QQuickItem* );
67QSK_EXPORT
void qskForceActiveFocus( QQuickItem*, Qt::FocusReason );
69QSK_EXPORT QList< QQuickItem* > qskPaintOrderChildItems(
const QQuickItem* );
71QSK_EXPORT
void qskUpdateInputMethod(
const QQuickItem*, Qt::InputMethodQueries );
72QSK_EXPORT
void qskInputMethodSetVisible(
const QQuickItem*,
bool );
74QSK_EXPORT
const QSGTransformNode* qskItemNode(
const QQuickItem* );
75QSK_EXPORT
const QSGNode* qskPaintNode(
const QQuickItem* );
77QSK_EXPORT
const QSGRootNode* qskScenegraphAnchorNode(
const QQuickItem* );
78QSK_EXPORT
const QSGRootNode* qskScenegraphAnchorNode(
const QQuickWindow* );
79QSK_EXPORT
void qskSetScenegraphAnchor( QQuickItem*,
bool on,
bool hide =
false );
81QSK_EXPORT
void qskItemUpdateRecursive( QQuickItem* );
83QSK_EXPORT
bool qskGrabMouse( QQuickItem* );
84QSK_EXPORT
void qskUngrabMouse( QQuickItem* );
85QSK_EXPORT
bool qskIsMouseGrabber(
const QQuickItem* );
87inline void qskSetItemGeometry(
88 QQuickItem* item, qreal x, qreal y, qreal width, qreal height )
90 qskSetItemGeometry( item, QRectF( x, y, width, height ) );
94inline T qskFindAncestorOf( QQuickItem* item )
96 for (
auto it = item; it !=
nullptr; it = it->parentItem() )
98 if (
auto ancestor = qobject_cast< T >( it ) )
105template<
typename T >
106inline T qskFindAncestorOf(
const QQuickItem* item )
108 return qskFindAncestorOf< T >(
const_cast< QQuickItem*
>( item ) );
111inline qreal qskHeightForWidth(
112 const QQuickItem* item, Qt::SizeHint which, qreal width )
114 return qskEffectiveSizeHint(
115 item, which, QSizeF( width, -1.0 ) ).height();
118inline qreal qskWidthForHeight(
119 const QQuickItem* item, Qt::SizeHint which, qreal height )
121 return qskEffectiveSizeHint(
122 item, which, QSizeF( -1.0, height ) ).width();
125inline QRectF qskConstrainedItemRect(
const QQuickItem* item,
const QRectF& rect )
127 return qskConstrainedItemRect( item, rect, qskLayoutAlignmentHint( item ) );