Utils: Adapt fake TipLabel to Qt >= 6/2

And fix a warning about some stack-allocated offsetsAndSize member going
out of scope.

Change-Id: Icfd1de121cb951783a96f8195c3160c65c405cd4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
hjk
2022-07-14 16:08:05 +02:00
parent d83eb0494a
commit 0108c48463

View File

@@ -71,21 +71,9 @@ const QMetaObject *TipLabel::metaObject() const
// CSS Tooltip styling depends on a the name of this class. // CSS Tooltip styling depends on a the name of this class.
// So set up a minimalist QMetaObject to fake a class name "QTipLabel": // So set up a minimalist QMetaObject to fake a class name "QTipLabel":
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
static const uint tip_label_meta_data[15] = { 8 /* moc revision */ };
static const QMetaObject tipMetaObject {
&QLabel::staticMetaObject, // SuperData superdata;
QByteArrayLiteral("QTipLabel").data_ptr(), // const QByteArrayData *stringdata;
tip_label_meta_data, // const uint *data;
nullptr, // StaticMetacallFunction static_metacall;
nullptr, // const SuperData *relatedMetaObjects;
nullptr // void *extradata;
};
#else
static const uint tip_label_meta_data[15] = { 9 /* moc revision */ }; static const uint tip_label_meta_data[15] = { 9 /* moc revision */ };
struct qt_meta_stringdata_Utils_t { static const struct {
const uint offsetsAndSize[2]; const uint offsetsAndSize[2];
char stringdata0[24]; char stringdata0[24];
} qt_meta_stringdata = { {8, sizeof("QTipLabel")}, "QTipLabel" }; } qt_meta_stringdata = { {8, sizeof("QTipLabel")}, "QTipLabel" };
@@ -99,7 +87,6 @@ const QMetaObject *TipLabel::metaObject() const
nullptr, // QtPrivate::QMetaTypeInterface *const *metaTypes; nullptr, // QtPrivate::QMetaTypeInterface *const *metaTypes;
nullptr, // void *extradata; nullptr, // void *extradata;
}; };
#endif
return &tipMetaObject; return &tipMetaObject;
} }