Commit b782d191 authored by David Schulz's avatar David Schulz
Browse files

cdbext: Add dumper for QPixmap.



Change-Id: Ib3935ed8ea03500e5787dcfdf9828f18539ffc93
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
parent 83b57eda
......@@ -81,6 +81,7 @@ enum KnownType
KT_QUrl = KT_Qt_Type + KT_Qt_MovableType + 31 + KT_HasSimpleDumper,
KT_QIcon = KT_Qt_Type + KT_Qt_MovableType + 32,
KT_QBrush = KT_Qt_Type + KT_Qt_MovableType + 33,
KT_QPixmap = KT_Qt_Type + KT_HasSimpleDumper + KT_Qt_MovableType + 34,
KT_QImage = KT_Qt_Type + KT_HasSimpleDumper + KT_Qt_MovableType + 35,
KT_QLocale = KT_Qt_Type + KT_Qt_MovableType + 36,
KT_QMatrix = KT_Qt_Type + KT_Qt_MovableType + 37,
......
......@@ -1199,6 +1199,8 @@ static KnownType knownClassTypeHelper(const std::string &type,
return KT_QMatrix;
if (!type.compare(qPos, 7, "QRegExp"))
return KT_QRegExp;
if (!type.compare(qPos, 7, "QPixmap"))
return KT_QPixmap;
break;
case 8:
if (!type.compare(qPos, 8, "QVariant"))
......@@ -2104,6 +2106,36 @@ static bool dumpQDateTime(const SymbolGroupValue &v, std::wostream &str)
return true;
}
static bool dumpQPixmap(const SymbolGroupValue &v, std::wostream &str)
{
const SymbolGroupValue pixmapSharedData = v["data"]["d"];
if (!pixmapSharedData.isValid())
return false;
ULONG64 addr = pixmapSharedData.pointerValue();
if (addr) {
const unsigned int width =
SymbolGroupValue::readIntValue(v.context().dataspaces,
addr += SymbolGroupValue::pointerSize(),
SymbolGroupValue::intSize(), 0);
const unsigned int height =
SymbolGroupValue::readIntValue(v.context().dataspaces,
addr += SymbolGroupValue::intSize(),
SymbolGroupValue::intSize(), 0);
const unsigned int depth =
SymbolGroupValue::readIntValue(v.context().dataspaces,
addr += SymbolGroupValue::intSize(),
SymbolGroupValue::intSize(), 0);
if (width && height) {
str << width << L'x' << height << L", depth: " << depth;
return true;
}
}
str << L"<null>";
return true;
}
static bool dumpQImage(const SymbolGroupValue &v, std::wostream &str, MemoryHandle **memoryHandle)
{
struct CreatorImageHeader { // Header for image display as edit format, followed by data.
......@@ -2668,6 +2700,9 @@ unsigned dumpSimpleType(SymbolGroupNode *n, const SymbolGroupValueContext &ctx,
case KT_QLineF:
rc = dumpQLine_F(v, str) ? SymbolGroupNode::SimpleDumperOk : SymbolGroupNode::SimpleDumperFailed;
break;
case KT_QPixmap:
rc = dumpQPixmap(v, str) ? SymbolGroupNode::SimpleDumperOk : SymbolGroupNode::SimpleDumperFailed;
break;
case KT_QImage:
rc = dumpQImage(v, str, memoryHandleIn) ? SymbolGroupNode::SimpleDumperOk : SymbolGroupNode::SimpleDumperFailed;
break;
......
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