Merge pull request #15 from skartashev/master
Qt 5.5.1 (ubuntu 16.04) compatibility buildfixes
This commit is contained in:
@@ -49,6 +49,32 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#if QT_VERSION < 0x050900
|
||||
|
||||
inline char toHexLower(uint value)
|
||||
{
|
||||
return "0123456789abcdef"[value & 0xF];
|
||||
}
|
||||
|
||||
QByteArray qByteArrayToHex(const QByteArray& src, char separator)
|
||||
{
|
||||
if(src.size() == 0)
|
||||
return QByteArray();
|
||||
|
||||
const int length = separator ? (src.size() * 3 - 1) : (src.size() * 2);
|
||||
QByteArray hex(length, Qt::Uninitialized);
|
||||
char *hexData = hex.data();
|
||||
const uchar *data = (const uchar *)src.data();
|
||||
for (int i = 0, o = 0; i < src.size(); ++i) {
|
||||
hexData[o++] = toHexLower(data[i] >> 4);
|
||||
hexData[o++] = toHexLower(data[i] & 0xf);
|
||||
|
||||
if ((separator) && (o < length))
|
||||
hexData[o++] = separator;
|
||||
}
|
||||
return hex;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace ads
|
||||
{
|
||||
@@ -1226,7 +1252,11 @@ void CDockContainerWidget::saveState(QXmlStreamWriter& s) const
|
||||
{
|
||||
CFloatingDockContainer* FloatingWidget = floatingWidget();
|
||||
QByteArray Geometry = FloatingWidget->saveGeometry();
|
||||
#if QT_VERSION < 0x050900
|
||||
s.writeTextElement("Geometry", qByteArrayToHex(Geometry, ' '));
|
||||
#else
|
||||
s.writeTextElement("Geometry", Geometry.toHex(' '));
|
||||
#endif
|
||||
}
|
||||
d->saveChildNodesState(s, d->RootSplitter);
|
||||
s.writeEndElement();
|
||||
|
||||
Reference in New Issue
Block a user