Can't convert const *char to QChar32
Posted: Fri Apr 17 2020 12:19 pm
It's a g++ error message that I vaguely recall. I put it here because of plain curiosity of how to proper adapt it to Cs. I think I will revisit it in the future but now I'm about to cancel my plan to adapt Lazarus' Qt5 binding to Cs as I think I have more to learn about Object Pascal.
The original code is here: https://github.com/graemeg/lazarus/blob/upstream/lcl/interfaces/qt5/cbindings/src/pascalbind.h
The problematic code:
I translated these line according to the migration guide (https://www.copperspice.com/docs/cs_api_1.6/class_qstring8.html#migration-qstring) into:
And g++ give this error message.
The original code is here: https://github.com/graemeg/lazarus/blob/upstream/lcl/interfaces/qt5/cbindings/src/pascalbind.h
The problematic code:
Code: Select all
inline void copyQStringToPWideString(const QString &qs, PWideString ps)
{
if (qs!=0 && ps) copyUnicodeToPWideString(qs.unicode(), ps, qs.length());
}
inline void copyPWideStringToQString(PWideString ps, QString &qs)
{
qs.setUtf16((ushort *)unicodeOfPWideString(ps),
lengthOfPWideString(ps));
}
Code: Select all
inline void copyQStringToPWideString(const QString &qs, PWideString ps)
{
if (qs!=0 && ps) copyUnicodeToPWideString(qs.constData(), ps, qs.length());
}
inline void copyPWideStringToQString(PWideString ps, QString &qs)
{
qs.fromUtf16((ushort *)unicodeOfPWideString(ps),
lengthOfPWideString(ps));
}