Qt6 incompatibilities fixed

This commit is contained in:
Uwe Rathmann 2020-10-26 17:59:19 +01:00
parent 8e410a9e4b
commit 93dc6f76f7
5 changed files with 32 additions and 7 deletions

View File

@ -886,7 +886,7 @@ void QskControl::itemChange( QQuickItem::ItemChange change,
Inherited::itemChange( change, value );
}
void QskControl::geometryChanged(
void QskControl::geometryChange(
const QRectF& newGeometry, const QRectF& oldGeometry )
{
if ( d_func()->autoLayoutChildren )
@ -895,7 +895,7 @@ void QskControl::geometryChanged(
polish();
}
Inherited::geometryChanged( newGeometry, oldGeometry );
Inherited::geometryChange( newGeometry, oldGeometry );
}
void QskControl::windowDeactivateEvent()

View File

@ -196,7 +196,7 @@ class QSK_EXPORT QskControl : public QskQuickItem, public QskSkinnable
virtual bool gestureFilter( QQuickItem*, QEvent* );
void itemChange( ItemChange, const ItemChangeData& ) override;
void geometryChanged( const QRectF&, const QRectF& ) override;
void geometryChange( const QRectF&, const QRectF& ) override;
void windowDeactivateEvent() override;
void initSizePolicy( QskSizePolicy::Policy, QskSizePolicy::Policy );

View File

@ -290,11 +290,16 @@ void QskQuickItem::setGeometry( qreal x, qreal y, qreal width, qreal height )
d->dirty( QQuickItemPrivate::Size );
/*
Unfortunately geometryChanged is protected and we can't implement
Unfortunately geometryChange(d) is protected and we can't implement
this code as qskSetItemGeometry - further hacking required: TODO ...
*/
geometryChanged( QRectF( d->x, d->y, d->width, d->height ), oldRect );
const QRectF newRect( d->x, d->y, d->width, d->height );
#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 )
geometryChange( newRect, oldRect );
#else
geometryChanged( newRect, oldRect );
#endif
}
}
@ -787,10 +792,24 @@ void QskQuickItem::itemChange( QQuickItem::ItemChange change,
Inherited::itemChange( change, value );
}
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
void QskQuickItem::geometryChanged(
const QRectF& newGeometry, const QRectF& oldGeometry )
{
geometryChange( newGeometry, oldGeometry );
}
#endif
void QskQuickItem::geometryChange(
const QRectF& newGeometry, const QRectF& oldGeometry )
{
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
Inherited::geometryChanged( newGeometry, oldGeometry );
#else
Inherited::geometryChange( newGeometry, oldGeometry );
#endif
Q_D( const QskQuickItem );
if ( !d->polishScheduled && d->polishOnResize )

View File

@ -118,7 +118,13 @@ class QSK_EXPORT QskQuickItem : public QQuickItem
virtual void windowChangeEvent( QskWindowChangeEvent* );
void itemChange( ItemChange, const ItemChangeData& ) override;
void geometryChanged( const QRectF&, const QRectF& ) override;
#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 )
void geometryChange( const QRectF&, const QRectF& ) override;
#else
// using geometryChange also for Qt5
void geometryChanged( const QRectF&, const QRectF& ) override final;
virtual void geometryChange( const QRectF&, const QRectF& );
#endif
virtual void aboutToShow(); // called in updatePolish

View File

@ -152,7 +152,7 @@ void QskQuickItemPrivate::setImplicitSize( qreal w, qreal h, bool doNotify )
const QRectF newRect( x, y, width, height );
Q_Q( QskQuickItem );
q->geometryChanged( newRect, oldRect );
q->geometryChange( newRect, oldRect );
}
}