dropping support for Qt < 5.15
This commit is contained in:
parent
ab095afb13
commit
1f0ad384ac
|
@ -71,7 +71,6 @@ GridQuick::~GridQuick()
|
||||||
void GridQuick::insert( const QByteArray& colorName,
|
void GridQuick::insert( const QByteArray& colorName,
|
||||||
int row, int column, int rowSpan, int columnSpan )
|
int row, int column, int rowSpan, int columnSpan )
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 15, 0 )
|
|
||||||
/*
|
/*
|
||||||
We need to create a temporary layout in QML, so that the
|
We need to create a temporary layout in QML, so that the
|
||||||
object for the attachedProperties is created early
|
object for the attachedProperties is created early
|
||||||
|
@ -82,9 +81,6 @@ void GridQuick::insert( const QByteArray& colorName,
|
||||||
rectangle->setParent( nullptr );
|
rectangle->setParent( nullptr );
|
||||||
|
|
||||||
delete layout;
|
delete layout;
|
||||||
#else
|
|
||||||
auto rectangle = createQml( "import QtQuick 2.0\nRectangle {}" );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
rectangle->setParent( m_grid );
|
rectangle->setParent( m_grid );
|
||||||
rectangle->setParentItem( m_grid );
|
rectangle->setParentItem( m_grid );
|
||||||
|
|
|
@ -9,6 +9,10 @@
|
||||||
#include <qcompilerdetection.h>
|
#include <qcompilerdetection.h>
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
|
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK( 5, 15, 0 )
|
||||||
|
static_assert( false, "QSkinny requires Qt >= 5.15" );
|
||||||
|
#endif
|
||||||
|
|
||||||
// QSK_VERSION is (major << 16) + (minor << 8) + patch.
|
// QSK_VERSION is (major << 16) + (minor << 8) + patch.
|
||||||
|
|
||||||
#define QSK_VERSION 0x000001
|
#define QSK_VERSION 0x000001
|
||||||
|
|
|
@ -60,7 +60,6 @@ static inline QColor qskInterpolatedColor(
|
||||||
|
|
||||||
return QColor::fromHsl( h, s, l, a );
|
return QColor::fromHsl( h, s, l, a );
|
||||||
}
|
}
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 )
|
|
||||||
case QColor::ExtendedRgb:
|
case QColor::ExtendedRgb:
|
||||||
{
|
{
|
||||||
const qreal r = valueF( c1.redF(), c2.redF(), ratio );
|
const qreal r = valueF( c1.redF(), c2.redF(), ratio );
|
||||||
|
@ -70,7 +69,6 @@ static inline QColor qskInterpolatedColor(
|
||||||
|
|
||||||
return QColor::fromRgbF( r, g, b, a );
|
return QColor::fromRgbF( r, g, b, a );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
case QColor::Invalid:
|
case QColor::Invalid:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,11 +76,7 @@ QPointF qskHoverPosition( const QHoverEvent* event )
|
||||||
|
|
||||||
QPointF qskWheelPosition( const QWheelEvent* event )
|
QPointF qskWheelPosition( const QWheelEvent* event )
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 )
|
|
||||||
return event->position();
|
return event->position();
|
||||||
#else
|
|
||||||
return event->posF();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -19,11 +19,7 @@ static inline QStringList qskSplitPath( const QString& s )
|
||||||
{
|
{
|
||||||
const auto separator = QDir::listSeparator();
|
const auto separator = QDir::listSeparator();
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 15, 0 )
|
|
||||||
return s.split( separator, Qt::SkipEmptyParts );
|
return s.split( separator, Qt::SkipEmptyParts );
|
||||||
#else
|
|
||||||
return s.split( separator, QString::SkipEmptyParts );
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -140,16 +140,9 @@ QPair< QString, QString > QskHunspellTextPredictor::affAndDicFile(
|
||||||
|
|
||||||
void QskHunspellTextPredictor::loadDictionaries()
|
void QskHunspellTextPredictor::loadDictionaries()
|
||||||
{
|
{
|
||||||
const auto splitBehavior =
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 )
|
|
||||||
Qt::SkipEmptyParts;
|
|
||||||
#else
|
|
||||||
QString::SkipEmptyParts;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
const auto userPaths = QString::fromUtf8( qgetenv( "QSK_HUNSPELL_PATH" ) );
|
const auto userPaths = QString::fromUtf8( qgetenv( "QSK_HUNSPELL_PATH" ) );
|
||||||
|
|
||||||
auto paths = userPaths.split( QDir::listSeparator(), splitBehavior );
|
auto paths = userPaths.split( QDir::listSeparator(), Qt::SkipEmptyParts );
|
||||||
|
|
||||||
#if !defined( Q_OS_WIN32 )
|
#if !defined( Q_OS_WIN32 )
|
||||||
paths += QStringLiteral( "/usr/share/hunspell" );
|
paths += QStringLiteral( "/usr/share/hunspell" );
|
||||||
|
|
|
@ -165,17 +165,12 @@ QSGTexture* QskTextureRenderer::textureFromId(
|
||||||
texture = QNativeInterface::QSGOpenGLTexture::fromNative(
|
texture = QNativeInterface::QSGOpenGLTexture::fromNative(
|
||||||
textureId, window, size, flags );
|
textureId, window, size, flags );
|
||||||
|
|
||||||
#elif QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 )
|
#else
|
||||||
|
|
||||||
const int nativeLayout = 0; // VkImageLayout in case of Vulkan
|
const int nativeLayout = 0; // VkImageLayout in case of Vulkan
|
||||||
|
|
||||||
texture = window->createTextureFromNativeObject(
|
texture = window->createTextureFromNativeObject(
|
||||||
QQuickWindow::NativeObjectTexture, &textureId, nativeLayout, size, flags );
|
QQuickWindow::NativeObjectTexture, &textureId, nativeLayout, size, flags );
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
texture = window->createTextureFromId( textureId, size, flags );
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return texture;
|
return texture;
|
||||||
|
|
Loading…
Reference in New Issue