not using QMetaObject::newInstance anymore, incompatibilities with Qt >=

12.4 fixed
This commit is contained in:
Uwe Rathmann 2019-06-25 20:27:40 +02:00
parent 0c87cb2a76
commit c139bf2f99
2 changed files with 17 additions and 6 deletions

View File

@ -32,8 +32,6 @@ It might support all versions Qt >= 5.6, but you can rely on:
- current long term supported ( LTS ) version of Qt
- current version of Qt
( Unfortunately Qt 12.4 and Qt 13.0 are broken - see https://bugreports.qt.io/browse/QTBUG-76663. Until this has been fixed you have to stay with Qt 12.3 )
If you want to know more about QSkinny - or even like to give it a specific
direction - please contact support@qskinny.org.

View File

@ -74,6 +74,22 @@ QSK_QT_PRIVATE_END
#include "QskStatusIndicator.h"
#include "QskStatusIndicatorSkinlet.h"
static inline QskSkinlet *qskNewSkinlet( const QMetaObject* metaObject, QskSkin* skin )
{
const QByteArray signature = metaObject->className() + QByteArrayLiteral( "(QskSkin*)" );
QskSkinlet *skinlet = nullptr;
const int index = metaObject->indexOfConstructor( signature.constData() );
if ( index >= 0 )
{
void *param[] = { &skinlet, &skin };
metaObject->static_metacall( QMetaObject::CreateInstance, index, param );
}
return skinlet;
}
namespace
{
class SkinletData
@ -434,10 +450,7 @@ QskSkinlet* QskSkin::skinlet( const QskSkinnable* skinnable )
auto& entry = it->second;
if ( entry.skinlet == nullptr )
{
entry.skinlet = reinterpret_cast< QskSkinlet* >(
entry.metaObject->newInstance( Q_ARG( QskSkin*, this ) ) );
}
entry.skinlet = qskNewSkinlet( entry.metaObject, this );
return entry.skinlet;
}