kross: src/core/metafunction.h:89 char* to QByteArrayData*
David Faure
faure at kde.org
Sun Feb 8 12:33:36 UTC 2015
On Wednesday 04 February 2015 19:54:36 Maximiliano Curia wrote:
> Hi,
>
> As part of the packaging efforts in Debian we are testing the installed
> headers to check that they compile correctly and have all their dependencies
> installed.
Nice :-)
> Testing kross we found this:
> // static metaobject
> staticMetaObject.d.superdata = &QObject::staticMetaObject;
> staticMetaObject.d.stringdata = m_stringData.data();
> staticMetaObject.d.data = m_data;
> staticMetaObject.d.extradata = 0;
>
> That seems to be the qt4 way, as stringdata is a const QByteArrayData* in
> qt5 (now reported in: https://bugs.kde.org/show_bug.cgi?id=343779).
>
> Adding a reinterpret_cast<const QByteArrayData *> fixes the issue, or even
> better using:
> staticMetaObject.d.stringdata = m_stringData.data_ptr();
That compiled but failed at runtime, because the string data has to be static,
not dynamic.
I wrote a unittest and upgraded the whole dynamic meta object generation in
metafunction.h to revision 7, as required by Qt 5. The unittest works, I
committed, this will be in 5.7.
Thanks for the report !
--
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
More information about the Kde-frameworks-devel
mailing list