QskControl::isVisibleTo added
This commit is contained in:
parent
dcf77a0ae1
commit
c752ee547f
|
@ -431,6 +431,11 @@ void QskControl::hide()
|
||||||
Inherited::setVisible( false );
|
Inherited::setVisible( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QskControl::isVisibleTo( const QQuickItem* ancestor ) const
|
||||||
|
{
|
||||||
|
return qskIsVisibleTo( this, ancestor );
|
||||||
|
}
|
||||||
|
|
||||||
void QskControl::setGeometry( qreal x, qreal y, qreal width, qreal height )
|
void QskControl::setGeometry( qreal x, qreal y, qreal width, qreal height )
|
||||||
{
|
{
|
||||||
// QQuickItem does not even offer changing the geometry
|
// QQuickItem does not even offer changing the geometry
|
||||||
|
@ -1633,6 +1638,9 @@ void QskControl::updatePolish()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !d->isInitiallyPainted )
|
||||||
|
aboutToShow();
|
||||||
|
|
||||||
updateLayout();
|
updateLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1727,6 +1735,10 @@ QRectF QskControl::focusIndicatorRect() const
|
||||||
return contentsRect();
|
return contentsRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QskControl::aboutToShow()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void QskControl::updateLayout()
|
void QskControl::updateLayout()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,6 +187,8 @@ public:
|
||||||
|
|
||||||
virtual QSizeF contentsSizeHint() const;
|
virtual QSizeF contentsSizeHint() const;
|
||||||
|
|
||||||
|
bool isVisibleTo( const QQuickItem* ) const;
|
||||||
|
|
||||||
QLocale locale() const;
|
QLocale locale() const;
|
||||||
void resetLocale();
|
void resetLocale();
|
||||||
|
|
||||||
|
@ -247,6 +249,7 @@ protected:
|
||||||
|
|
||||||
void cleanupNodes();
|
void cleanupNodes();
|
||||||
|
|
||||||
|
virtual void aboutToShow(); // called in updatePolish
|
||||||
virtual void updateLayout(); // called in updatePolish
|
virtual void updateLayout(); // called in updatePolish
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -64,6 +64,27 @@ bool qskIsAncestorOf( const QQuickItem* item, const QQuickItem* child )
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool qskIsVisibleTo( const QQuickItem* item, const QQuickItem* ancestor )
|
||||||
|
{
|
||||||
|
if ( item == nullptr )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if ( ancestor == nullptr )
|
||||||
|
return item->isVisible(); // like QWidget::isVisibleTo
|
||||||
|
|
||||||
|
for ( item = item->parentItem();
|
||||||
|
item = item->parentItem(); item != ancestor )
|
||||||
|
{
|
||||||
|
if ( item == nullptr )
|
||||||
|
return false; // ancestor is no parent
|
||||||
|
|
||||||
|
if ( !QQuickItemPrivate::get( item )->explicitVisible )
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool qskIsTabFence( const QQuickItem* item )
|
bool qskIsTabFence( const QQuickItem* item )
|
||||||
{
|
{
|
||||||
if ( item == nullptr )
|
if ( item == nullptr )
|
||||||
|
|
|
@ -19,6 +19,7 @@ QSK_EXPORT bool qskIsAncestorOf( const QQuickItem* item, const QQuickItem* child
|
||||||
QSK_EXPORT bool qskIsTransparentForPositioner( const QQuickItem* );
|
QSK_EXPORT bool qskIsTransparentForPositioner( const QQuickItem* );
|
||||||
QSK_EXPORT bool qskIsTabFence( const QQuickItem* );
|
QSK_EXPORT bool qskIsTabFence( const QQuickItem* );
|
||||||
QSK_EXPORT bool qskIsShortcutScope( const QQuickItem* );
|
QSK_EXPORT bool qskIsShortcutScope( const QQuickItem* );
|
||||||
|
QSK_EXPORT bool qskIsVisibleTo( const QQuickItem* item, const QQuickItem* ancestor );
|
||||||
|
|
||||||
QSK_EXPORT QRectF qskItemRect( const QQuickItem* );
|
QSK_EXPORT QRectF qskItemRect( const QQuickItem* );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue