QSqlField fld = rec.field(i);
model->setData(model->index(i, 0), fld.name());
model->setData(model->index(i, 1), fld.typeID() == -1
- ? QString(QVariant::typeToName(fld.type()))
- : QString("%1 (%2)").arg(QVariant::typeToName(fld.type())).arg(fld.typeID()));
+ ? QString(QMetaType::typeName(fld.type()))
+ : QString("%1 (%2)").arg(QMetaType::typeName(fld.type())).arg(fld.typeID()));
model->setData(model->index(i, 2), fld.length());
model->setData(model->index(i, 3), fld.precision());
model->setData(model->index(i, 4), fld.requiredStatus() == -1 ? QVariant("?")
*/
const char *QVariant::typeName() const
{
- return typeToName(d.type);
+ return QMetaType::typeName(d.type);
}
/*!
if (!signature) {
qWarning("QDBusMarshaller: type `%s' (%d) is not registered with D-BUS. "
"Use qDBusRegisterMetaType to register it",
- QVariant::typeToName( QVariant::Type(id) ), id);
+ QMetaType::typeName(id), id);
error(QString::fromLatin1("Unregistered type %1 passed in arguments")
- .arg(QLatin1String(QVariant::typeToName(QVariant::Type(id)))));
+ .arg(QLatin1String(QMetaType::typeName(id))));
return this;
}
if (!ksignature) {
qWarning("QDBusMarshaller: type `%s' (%d) is not registered with D-BUS. "
"Use qDBusRegisterMetaType to register it",
- QVariant::typeToName( QVariant::Type(kid) ), kid);
+ QMetaType::typeName(kid), kid);
error(QString::fromLatin1("Unregistered type %1 passed in arguments")
- .arg(QLatin1String(QVariant::typeToName(QVariant::Type(kid)))));
+ .arg(QLatin1String(QMetaType::typeName(kid))));
return this;
}
if (ksignature[1] != 0 || !QDBusUtil::isValidBasicType(*ksignature)) {
qWarning("QDBusMarshaller: type '%s' (%d) cannot be used as the key type in a D-BUS map.",
- QVariant::typeToName( QVariant::Type(kid) ), kid);
+ QMetaType::typeName(kid), kid);
error(QString::fromLatin1("Type %1 passed in arguments cannot be used as a key in a map")
- .arg(QLatin1String(QVariant::typeToName(QVariant::Type(kid)))));
+ .arg(QLatin1String(QMetaType::typeName(kid))));
return this;
}
const char *vsignature = QDBusMetaType::typeToSignature( QVariant::Type(vid) );
if (!vsignature) {
- const char *typeName = QVariant::typeToName(QVariant::Type(vid));
+ const char *typeName = QMetaType::typeName(vid);
qWarning("QDBusMarshaller: type `%s' (%d) is not registered with D-BUS. "
"Use qDBusRegisterMetaType to register it",
typeName, vid);
if (!signature) {
qWarning("QDBusMarshaller: type `%s' (%d) is not registered with D-BUS. "
"Use qDBusRegisterMetaType to register it",
- QVariant::typeToName( QVariant::Type(id) ), id);
+ QMetaType::typeName(id), id);
error(QString::fromLatin1("Unregistered type %1 passed in arguments")
- .arg(QLatin1String(QVariant::typeToName(QVariant::Type(id)))));
+ .arg(QLatin1String(QMetaType::typeName(id))));
return false;
}
type = -1;
}
} else {
- result.name = QVariant::typeToName( QVariant::Type(type) );
+ result.name = QMetaType::typeName(type);
}
result.id = type;
} else {
// not an argument and doesn't match?
int type = reply.arguments().at(0).userType();
- receivedType = QVariant::typeToName(QVariant::Type(type));
+ receivedType = QMetaType::typeName(type);
receivedSignature = QDBusMetaType::typeToSignature(type);
}
}
.arg(QLatin1String(accessvalues[access]));
if (QDBusMetaType::signatureToType(signature) == QVariant::Invalid) {
- const char *typeName = QVariant::typeToName(QVariant::Type(typeId));
+ const char *typeName = QMetaType::typeName(typeId);
retval += QString::fromLatin1(">\n <annotation name=\"org.qtproject.QtDBus.QtTypeName\" value=\"%3\"/>\n </property>\n")
.arg(typeNameToXml(typeName));
} else {
// do we need to describe this argument?
if (QDBusMetaType::signatureToType(typeName) == QVariant::Invalid)
xml += QString::fromLatin1(" <annotation name=\"org.qtproject.QtDBus.QtTypeName.Out0\" value=\"%1\"/>\n")
- .arg(typeNameToXml(QVariant::typeToName(QVariant::Type(typeId))));
+ .arg(typeNameToXml(QMetaType::typeName(typeId)));
} else
continue;
}
// do we need to describe this argument?
if (QDBusMetaType::signatureToType(signature) == QVariant::Invalid) {
- const char *typeName = QVariant::typeToName( QVariant::Type(types.at(j)) );
+ const char *typeName = QMetaType::typeName(types.at(j));
xml += QString::fromLatin1(" <annotation name=\"org.qtproject.QtDBus.QtTypeName.%1%2\" value=\"%3\"/>\n")
.arg(isOutput ? QLatin1String("Out") : QLatin1String("In"))
.arg(isOutput && !isSignal ? j - inputCount : j - 1)
#ifndef QT_NO_DEBUG_STREAM
QDebug operator<<(QDebug dbg, const QSqlField &f)
{
- dbg.nospace() << "QSqlField(" << f.name() << ", " << QVariant::typeToName(f.type());
+ dbg.nospace() << "QSqlField(" << f.name() << ", " << QMetaType::typeName(f.type());
if (f.length() >= 0)
dbg.nospace() << ", length: " << f.length();
if (f.precision() >= 0)