forked from qt-creator/qt-creator
debugger: make QVariant dumper compile with QT_NO_SHORTCUT
This commit is contained in:
@@ -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);
|
||||||
|
Reference in New Issue
Block a user