debugger: make QVariant dumper compile with QT_NO_SHORTCUT

This commit is contained in:
hjk
2009-11-12 09:25:01 +01:00
parent 2df118c1a7
commit 80a112f677

View File

@@ -2135,19 +2135,23 @@ static void qDumpQVariantHelper(const QVariant *v, QString *value,
*value = qvariant_cast<QColor>(*v).name(); *value = qvariant_cast<QColor>(*v).name();
break; break;
case QVariant::KeySequence: case QVariant::KeySequence:
#ifndef QT_NO_SHORTCUT
*value = qvariant_cast<QKeySequence>(*v).toString(); *value = qvariant_cast<QKeySequence>(*v).toString();
#else
*value = QString::fromLatin1("Disabled by QT_NO_SHORTCUT");
#endif
break; break;
case QVariant::SizePolicy: case QVariant::SizePolicy:
*value = sizePolicyValue(qvariant_cast<QSizePolicy>(*v)); *value = sizePolicyValue(qvariant_cast<QSizePolicy>(*v));
break; break;
#endif #endif
default: { default: {
static const char *qTypeFormat = sizeof(void *) == sizeof(long) ? static const char *qTypeFormat = sizeof(void *) == sizeof(long)
"'"NS"%s "NS"qVariantValue<"NS"%s >'(*('"NS"QVariant'*)0x%lx)" : ? "'"NS"%s "NS"qVariantValue<"NS"%s >'(*('"NS"QVariant'*)0x%lx)"
"'"NS"%s "NS"qVariantValue<"NS"%s >'(*('"NS"QVariant'*)0x%llx)"; : "'"NS"%s "NS"qVariantValue<"NS"%s >'(*('"NS"QVariant'*)0x%llx)";
static const char *nonQTypeFormat = sizeof(void *) == sizeof(long) ? static const char *nonQTypeFormat = sizeof(void *) == sizeof(long)
"'%s "NS"qVariantValue<%s >'(*('"NS"QVariant'*)0x%lx)" : ? "'%s "NS"qVariantValue<%s >'(*('"NS"QVariant'*)0x%lx)"
"'%s "NS"qVariantValue<%s >'(*('"NS"QVariant'*)0x%llx)"; : "'%s "NS"qVariantValue<%s >'(*('"NS"QVariant'*)0x%llx)";
char buf[1000]; char buf[1000];
const char *format = (v->typeName()[0] == 'Q') ? qTypeFormat : nonQTypeFormat; const char *format = (v->typeName()[0] == 'Q') ? qTypeFormat : nonQTypeFormat;
qsnprintf(buf, sizeof(buf) - 1, format, v->typeName(), v->typeName(), v); qsnprintf(buf, sizeof(buf) - 1, format, v->typeName(), v->typeName(), v);