本文整理汇总了C++中QXmlInputSource::data方法的典型用法代码示例。如果您正苦于以下问题:C++ QXmlInputSource::data方法的具体用法?C++ QXmlInputSource::data怎么用?C++ QXmlInputSource::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QXmlInputSource
的用法示例。
在下文中一共展示了QXmlInputSource::data方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reset
/*!
\internal
\since 4.4
See task 166278.
*/
void tst_QXmlInputSource::reset() const
{
const QString input(QString::fromLatin1("<element attribute1='value1' attribute2='value2'/>"));
QXmlSimpleReader reader;
QXmlDefaultHandler handler;
reader.setContentHandler(&handler);
QXmlInputSource source;
source.setData(input);
QCOMPARE(source.data(), input);
source.reset();
QCOMPARE(source.data(), input);
source.reset();
QVERIFY(reader.parse(source));
source.reset();
QCOMPARE(source.data(), input);
}
示例2: resetSimplified
/*!
\internal
\since 4.4
See task 166278.
*/
void tst_QXmlInputSource::resetSimplified() const
{
const QString input(QString::fromLatin1("<element/>"));
QXmlSimpleReader reader;
QXmlInputSource source;
source.setData(input);
QVERIFY(reader.parse(source));
source.reset();
QCOMPARE(source.data(), input);
}
示例3: sipIsDerived
static PyObject *meth_QXmlInputSource_data(PyObject *sipSelf, PyObject *sipArgs)
{
PyObject *sipParseErr = NULL;
bool sipSelfWasArg = (!sipSelf || sipIsDerived((sipSimpleWrapper *)sipSelf));
{
QXmlInputSource *sipCpp;
if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QXmlInputSource, &sipCpp))
{
QString *sipRes;
Py_BEGIN_ALLOW_THREADS
sipRes = new QString((sipSelfWasArg ? sipCpp->QXmlInputSource::data() : sipCpp->data()));
Py_END_ALLOW_THREADS
return sipConvertFromNewType(sipRes,sipType_QString,NULL);
}
}