using QQuickItem::fontPolicy available since Qt 6.7

This commit is contained in:
Uwe Rathmann 2025-01-05 16:44:15 +01:00
parent 33a482505a
commit 57162cdff1
2 changed files with 16 additions and 6 deletions

View File

@ -414,14 +414,10 @@ bool QskItem::isTabFence() const
return d_func()->isTabFence;
}
#if QT_VERSION < QT_VERSION_CHECK( 6, 7, 0 )
void QskItem::setFocusPolicy( Qt::FocusPolicy policy )
{
/*
Qt::FocusPolicy has always been there with widgets, got lost with
Qt/Quick and has been reintroduced with Qt/Quick Controls 2 ( QC2 ).
Unfortunately this was done by adding code on top instead of fixing
the foundation.
*/
Q_D( QskItem );
if ( policy != d->focusPolicy )
{
@ -454,6 +450,14 @@ Qt::FocusPolicy QskItem::focusPolicy() const
return static_cast< Qt::FocusPolicy >( policy );
}
#else
/*
shifting the activeFocusItem before removing it from the tab focus
chain is not done by QQuickItem::setFocusPolicy. TODO ...
*/
#endif
void QskItem::setWheelEnabled( bool on )
{
Q_D( QskItem );

View File

@ -29,8 +29,10 @@ class QSK_EXPORT QskItem : public QQuickItem
Q_PROPERTY( bool polishOnParentResize READ polishOnParentResize
WRITE setPolishOnParentResize NOTIFY itemFlagsChanged FINAL )
#if QT_VERSION < QT_VERSION_CHECK( 6, 7, 0 )
Q_PROPERTY( Qt::FocusPolicy focusPolicy READ focusPolicy
WRITE setFocusPolicy NOTIFY focusPolicyChanged )
#endif
Q_PROPERTY( bool wheelEnabled READ isWheelEnabled
WRITE setWheelEnabled NOTIFY wheelEnabledChanged )
@ -87,8 +89,10 @@ class QSK_EXPORT QskItem : public QQuickItem
void setPolishOnParentResize( bool );
bool polishOnParentResize() const;
#if QT_VERSION < QT_VERSION_CHECK( 6, 7, 0 )
void setFocusPolicy( Qt::FocusPolicy );
Qt::FocusPolicy focusPolicy() const;
#endif
void setTabFence( bool );
bool isTabFence() const;
@ -119,7 +123,9 @@ class QSK_EXPORT QskItem : public QQuickItem
Q_SIGNALS:
void wheelEnabledChanged( bool );
#if QT_VERSION < QT_VERSION_CHECK( 6, 7, 0 )
void focusPolicyChanged( Qt::FocusPolicy );
#endif
void itemFlagsChanged();
void updateFlagsChanged( UpdateFlags );