Qt 6.2 adjustments

This commit is contained in:
Uwe Rathmann 2021-09-21 08:51:01 +02:00
parent c5ebb6c298
commit f9ca36443e
5 changed files with 51 additions and 12 deletions

View File

@ -9,10 +9,8 @@
#include "QskGlobal.h"
#include <qmetaobject.h>
/*
hack to run moc over a namespace, what is not
yet supported with Qt 5.6
*/
#if QT_VERSION < QT_VERSION_CHECK( 5, 8, 0 )
// hack to run moc over a namespace
#ifdef Q_MOC_RUN
@ -28,9 +26,19 @@
#endif
#define QSK_Q_NAMESPACE extern const QMetaObject staticMetaObject;
#else
#define QSK_NAMESPACE( name ) namespace name
#define QSK_ENUM Q_ENUM_NS
#define QSK_Q_NAMESPACE Q_NAMESPACE
#endif
QSK_NAMESPACE( Qsk )
{
extern QSK_EXPORT const QMetaObject staticMetaObject;
QSK_EXPORT QSK_Q_NAMESPACE
enum Direction
{
@ -62,5 +70,6 @@ QSK_NAMESPACE( Qsk )
#undef QSK_NAMESPACE
#undef QSK_ENUM
#undef QSK_Q_NAMESPACE
#endif

View File

@ -256,8 +256,13 @@ void QskQuickItem::setGeometry( qreal x, qreal y, qreal width, qreal height )
Q_D( QQuickItem );
#if QT_VERSION >= QT_VERSION_CHECK( 6, 2, 0 )
d->heightValidFlag = true;
d->widthValidFlag = true;
#else
d->heightValid = true;
d->widthValid = true;
#endif
const QRectF oldRect( d->x, d->y, d->width, d->height );
@ -541,7 +546,11 @@ void QskQuickItem::applyUpdateFlag( UpdateFlag flag, bool on )
// Update the implicitSize and rebind the size to it.
// Having set the size explicitly gets lost.
#if QT_VERSION >= QT_VERSION_CHECK( 6, 2, 0 )
d->widthValidFlag = d->heightValidFlag = false;
#else
d->widthValid = d->heightValid = false;
#endif
d->updateImplicitSize( false );
}

View File

@ -38,7 +38,11 @@ QskQuickItemPrivate::QskQuickItemPrivate()
but to make it working: the DeferredLayout flag needs to be disabled.
*/
#if QT_VERSION >= QT_VERSION_CHECK( 6, 2, 0 )
widthValidFlag = heightValidFlag = true;
#else
widthValid = heightValid = true;
#endif
}
}
@ -130,6 +134,11 @@ void QskQuickItemPrivate::setImplicitSize( qreal w, qreal h, bool doNotify )
implicitWidth = w;
implicitHeight = h;
#if QT_VERSION >= QT_VERSION_CHECK( 6, 2, 0 )
const bool widthValid = widthValidFlag;
const bool heightValid = heightValidFlag;
#endif
if ( !( widthValid && heightValid ) )
{
// auto adjusting the size

View File

@ -19,6 +19,13 @@
#include <qvariantanimation.h>
QSK_QT_PRIVATE_BEGIN
#if QT_VERSION >= QT_VERSION_CHECK( 6, 2, 0 )
#ifndef emit
// qvariantanimation_p.h needs it
#define emit
#endif
#endif
#include <private/qvariantanimation_p.h>
QSK_QT_PRIVATE_END

View File

@ -58,8 +58,13 @@ namespace
{
auto d = QQuickTextPrivate::get( this );
#if QT_VERSION >= QT_VERSION_CHECK( 6, 2, 0 )
d->heightValidFlag = true;
d->widthValidFlag = true;
#else
d->heightValid = true;
d->widthValid = true;
#endif
if ( ( d->x != rect.x() ) || ( d->y != rect.y() ) )
{