Commit fcbbb9bb authored by Thomas BOUTROUE's avatar Thomas BOUTROUE

Use QString::fromXXX (QByteArray::fromRawData (ptr, len)) to avoid bug

parent 2280fcb2
......@@ -112,16 +112,16 @@ QVariant CanOpenSubEntry::readToQtVariant (void) const {
return QVariant::fromValue (double (* reinterpret_cast<double *> (m_dataPtr)));
}
case CanOpenDataTypes::VisibleStr: {
return QVariant::fromValue (QString::fromLatin1 (reinterpret_cast<const char *> (m_dataPtr), int (m_dataLen)));
return QVariant::fromValue (QString::fromLatin1 (QByteArray::fromRawData (reinterpret_cast<const char *> (m_dataPtr), int (m_dataLen))));
}
case CanOpenDataTypes::OctetStr: {
return QVariant::fromValue (QString::fromLocal8Bit (reinterpret_cast<const char *> (m_dataPtr), int (m_dataLen)));
return QVariant::fromValue (QString::fromLocal8Bit (QByteArray::fromRawData (reinterpret_cast<const char *> (m_dataPtr), int (m_dataLen))));
}
case CanOpenDataTypes::UnicodeStr: {
return QVariant::fromValue (QString::fromUtf8 (reinterpret_cast<const char *> (m_dataPtr), int (m_dataLen)));
return QVariant::fromValue (QString::fromUtf8 (QByteArray::fromRawData (reinterpret_cast<const char *> (m_dataPtr), int (m_dataLen))));
}
case CanOpenDataTypes::Domain: {
return QVariant::fromValue (QString::fromLatin1 (QByteArray (reinterpret_cast<const char *> (m_dataPtr), int (m_dataLen)).toHex ()));
return QVariant::fromValue (QString::fromLatin1 (QByteArray::fromRawData (reinterpret_cast<const char *> (m_dataPtr), int (m_dataLen)).toHex ()));
}
case CanOpenDataTypes::Int24:
case CanOpenDataTypes::Int40:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment