本文整理汇总了C++中QXmlName::namespaceUri方法的典型用法代码示例。如果您正苦于以下问题:C++ QXmlName::namespaceUri方法的具体用法?C++ QXmlName::namespaceUri怎么用?C++ QXmlName::namespaceUri使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QXmlName
的用法示例。
在下文中一共展示了QXmlName::namespaceUri方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resetSchemaNamePool
void tst_QXmlSchemaValidator::resetSchemaNamePool() const
{
QXmlSchema schema1;
QXmlNamePool np1 = schema1.namePool();
const QXmlName name1(np1, QLatin1String("localName"),
QLatin1String("http://example.com/"),
QLatin1String("prefix"));
QXmlSchemaValidator validator(schema1);
{
QXmlNamePool compNamePool(validator.namePool());
QCOMPARE(name1.namespaceUri(compNamePool), QString::fromLatin1("http://example.com/"));
QCOMPARE(name1.localName(compNamePool), QString::fromLatin1("localName"));
QCOMPARE(name1.prefix(compNamePool), QString::fromLatin1("prefix"));
}
QXmlSchema schema2;
QXmlNamePool np2 = schema2.namePool();
const QXmlName name2(np2, QLatin1String("remoteName"),
QLatin1String("http://example.com/"),
QLatin1String("suffix"));
// make sure that after re-setting the schema, the new namepool is used
validator.setSchema(schema2);
{
QXmlNamePool compNamePool(validator.namePool());
QCOMPARE(name2.namespaceUri(compNamePool), QString::fromLatin1("http://example.com/"));
QCOMPARE(name2.localName(compNamePool), QString::fromLatin1("remoteName"));
QCOMPARE(name2.prefix(compNamePool), QString::fromLatin1("suffix"));
}
}
示例2: constCorrectness
/*!
Check that functions have the correct const qualification.
*/
void tst_QXmlName::constCorrectness() const
{
const QXmlName name;
/* isNull() */
QVERIFY(name.isNull());
/* operator==() */
QVERIFY(name == name);
/* operator!=() */
QVERIFY(!(name != name));
QXmlNamePool namePool;
const QXmlName name2(namePool, QLatin1String("localName"), QLatin1String("http://example.com/"), QLatin1String("prefix"));
/* namespaceUri(). */
QCOMPARE(name2.namespaceUri(namePool), QLatin1String("http://example.com/"));
/* localName(). */
QCOMPARE(name2.localName(namePool), QLatin1String("localName"));
/* prefix(). */
QCOMPARE(name2.prefix(namePool), QLatin1String("prefix"));
/* toClarkname(). */
QCOMPARE(name2.toClarkName(namePool), QLatin1String("{http://example.com/}prefix:localName"));
}
示例3: namePool
void tst_QSimpleXmlNodeModel::namePool() const
{
/* Check that the name pool we pass in, is what actually is returned. */
QXmlNamePool np;
const QXmlName name(np, QLatin1String("localName"),
QLatin1String("http://example.com/XYZ"),
QLatin1String("prefix432"));
TestSimpleNodeModel model(np);
const QXmlNamePool np2(model.namePool());
/* If it's a bug, this will more or less crash. */
QCOMPARE(name.namespaceUri(np2), QString::fromLatin1("http://example.com/XYZ"));
QCOMPARE(name.localName(np2), QString::fromLatin1("localName"));
QCOMPARE(name.prefix(np2), QString::fromLatin1("prefix432"));
}
示例4: sipConvertFromNewType
static PyObject *meth_QXmlName_namespaceUri(PyObject *sipSelf, PyObject *sipArgs)
{
PyObject *sipParseErr = NULL;
{
const QXmlNamePool * a0;
QXmlName *sipCpp;
if (sipParseArgs(&sipParseErr, sipArgs, "BJ9", &sipSelf, sipType_QXmlName, &sipCpp, sipType_QXmlNamePool, &a0))
{
QString *sipRes;
Py_BEGIN_ALLOW_THREADS
sipRes = new QString(sipCpp->namespaceUri(*a0));
Py_END_ALLOW_THREADS
return sipConvertFromNewType(sipRes,sipType_QString,NULL);
}
}
示例5: constructorQXmlNamePool
void tst_QXmlSchema::constructorQXmlNamePool() const
{
QXmlSchema schema;
QXmlNamePool np = schema.namePool();
const QXmlName name(np, QLatin1String("localName"),
QLatin1String("http://example.com/"),
QLatin1String("prefix"));
QXmlNamePool np2(schema.namePool());
QCOMPARE(name.namespaceUri(np2), QString::fromLatin1("http://example.com/"));
QCOMPARE(name.localName(np2), QString::fromLatin1("localName"));
QCOMPARE(name.prefix(np2), QString::fromLatin1("prefix"));
// make sure namePool() is const
const QXmlSchema constSchema;
np = constSchema.namePool();
}
示例6: constructorQXmlNamePool
void tst_QXmlSchemaValidator::constructorQXmlNamePool() const
{
// test that the name pool from the schema is used by
// the schema validator as well
QXmlSchema schema;
QXmlNamePool np = schema.namePool();
const QXmlName name(np, QLatin1String("localName"),
QLatin1String("http://example.com/"),
QLatin1String("prefix"));
QXmlSchemaValidator validator(schema);
QXmlNamePool np2(validator.namePool());
QCOMPARE(name.namespaceUri(np2), QString::fromLatin1("http://example.com/"));
QCOMPARE(name.localName(np2), QString::fromLatin1("localName"));
QCOMPARE(name.prefix(np2), QString::fromLatin1("prefix"));
// make sure namePool() is const
const QXmlSchemaValidator constValidator(schema);
np = constValidator.namePool();
}