Commit 95c0b1c1 authored by hjk's avatar hjk
Browse files

debugger: cosmetical improvements of QVariant dumper output

parent 263cda82
......@@ -2013,7 +2013,7 @@ static void qDumpQVariantHelper(const void *data, QString *value,
*numchild = 0;
break;
case QVariant::StringList:
*exp = QString(QLatin1String("((QVariant*)%1)->d.data.c"))
*exp = QString(QLatin1String("(('"NS"QVariant'*)%1)->d.data.c"))
.arg((quintptr)data);
*numchild = v.toStringList().size();
break;
......@@ -2057,7 +2057,7 @@ static void qDumpQVariant(QDumper &d)
ba += ") ";
ba += qPrintable(value);
P(d, "value", ba);
P(d, "valueencoded", "1");
P(d, "valueencoded", "4");
}
P(d, "type", NS"QVariant");
P(d, "numchild", (isInvalid ? "0" : "1"));
......@@ -2069,7 +2069,7 @@ static void qDumpQVariant(QDumper &d)
P(d, "exp", qPrintable(exp));
if (!value.isEmpty()) {
P(d, "value", value);
P(d, "valueencoded", "1");
P(d, "valueencoded", "4");
}
P(d, "type", v.typeName());
P(d, "numchild", numchild);
......
......@@ -2790,6 +2790,9 @@ static void setWatchDataValue(WatchData &data, const GdbMi &mi,
ba = QString::fromUcs4((uint *)ba.data(), ba.size() / 4).toUtf8();
ba = '"' + ba + '"';
break;
case 4: // base64 encoded 8 bit data
ba = QByteArray::fromBase64(mi.data());
break;
}
data.setValue(ba);
} else {
......
......@@ -783,10 +783,18 @@ void testQVariant1()
void testQVariant2()
{
int i = 1;
QVariant var;
var.setValue(1);
var.setValue(2);
var.setValue(3);
var.setValue(QString("Hello"));
var.setValue(QString("World"));
var.setValue(QString("Hello"));
var.setValue(QStringList() << "World");
var.setValue(QStringList() << "Hello");
var.setValue(QStringList() << "World");
var.setValue(QStringList() << "World" << "Hello");
var.setValue(QStringList() << "Hello" << "Hello");
var.setValue(QStringList() << "World" << "Hello" << "Hello");
#if 0
QVariant var3;
QHostAddress ha("127.0.0.1");
......
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