当前位置: 首页>>代码示例>>C++>>正文


C++ QXmlStreamWriter::device方法代码示例

本文整理汇总了C++中QXmlStreamWriter::device方法的典型用法代码示例。如果您正苦于以下问题:C++ QXmlStreamWriter::device方法的具体用法?C++ QXmlStreamWriter::device怎么用?C++ QXmlStreamWriter::device使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QXmlStreamWriter的用法示例。


在下文中一共展示了QXmlStreamWriter::device方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: WriteChannel

	void WriteChannel (QXmlStreamWriter& w,
			const ChannelShort& cs, const QList<Item_ptr>& items)
	{
		w.writeStartElement ("section");
			w.writeAttribute ("id", QString::number (cs.ChannelID_));
			w.writeStartElement ("title");
				w.writeTextElement ("p", FixContents (cs.Title_));
			w.writeEndElement ();
			w.writeTextElement ("annotation",
					Export2FB2Dialog::tr ("%n unread item(s)", "", cs.Unread_));
			Q_FOREACH (Item_ptr item, items)
			{
				w.writeStartElement ("title");
					w.writeStartElement ("p");
					w.writeComment ("p");
					w.device ()->write (FixContents (item->Title_).toUtf8 ());
					w.writeEndElement ();
				w.writeEndElement ();

				bool hasDate = item->PubDate_.isValid ();
				bool hasAuthor = item->Author_.size ();
				if (hasDate || hasAuthor)
				{
					w.writeStartElement ("epigraph");
						if (hasDate)
							w.writeTextElement ("p",
									Export2FB2Dialog::tr ("Published on %1")
										.arg (item->PubDate_.toString ()));
						if (hasAuthor)
							w.writeTextElement ("p",
									Export2FB2Dialog::tr ("By %1")
										.arg (item->Author_));
					w.writeEndElement ();
					w.writeEmptyElement ("empty-line");
				}

				w.writeStartElement ("p");
					w.writeComment ("p");
					w.device ()->write (FixContents (item->Description_).toUtf8 ());
				w.writeEndElement ();

				w.writeEmptyElement ("empty-line");
			}
开发者ID:Akon32,项目名称:leechcraft,代码行数:43,代码来源:export2fb2dialog.cpp

示例2: appendComponent

	void appendComponent( QXmlStreamWriter &stream, const Billon &billon, const uint &firstSlicePos, const int &index )
	{
		const uint &width = billon.n_cols;
		const uint &height = billon.n_rows;
		const uint &depth = billon.n_slices;

		uint i, j, k;

		stream.writeStartElement("component");
		stream.writeAttribute("id",QString::number(index));
		stream.writeAttribute("valmax",QString::number(billon.maxValue()));
		stream.writeAttribute("valmin",QString::number(billon.minValue()));

		//coord minimum
		stream.writeStartElement("coord");
		stream.writeAttribute("name","minimum");
		stream.writeTextElement("x",QString::number(0));
		stream.writeTextElement("y",QString::number(0));
		stream.writeTextElement("z",QString::number(firstSlicePos));
		stream.writeEndElement();

		//coord maximum
		stream.writeStartElement("coord");
		stream.writeAttribute("name","maximum");
		stream.writeTextElement("x",QString::number(width-1));
		stream.writeTextElement("y",QString::number(height-1));
		stream.writeTextElement("z",QString::number(firstSlicePos+billon.n_slices-1));
		stream.writeEndElement();

		//binarydata
		stream.writeStartElement("binarydata");
		stream.writeAttribute("encoding","16");
		stream.writeCharacters("");
		QDataStream voxelStream(stream.device());
		for ( k=0; k<depth; ++k )
		{
			const Slice &slice = billon.slice(k);
			for ( j=0; j<height; ++j )
			{
				for ( i=0; i<width; ++i )
				{
					voxelStream << (qint16)(slice.at(j,i));
				}
			}
		}
		stream.writeEndElement();

		stream.writeEndElement();
	}
开发者ID:kerautret,项目名称:TKDetection,代码行数:49,代码来源:v3dexport.cpp

示例3: sipConvertFromType

static PyObject *meth_QXmlStreamWriter_device(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
        QXmlStreamWriter *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QXmlStreamWriter, &sipCpp))
        {
            QIODevice *sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->device();
            Py_END_ALLOW_THREADS

            return sipConvertFromType(sipRes,sipType_QIODevice,NULL);
        }
    }
开发者ID:ClydeMojura,项目名称:android-python27,代码行数:18,代码来源:sipQtCoreQXmlStreamWriter.cpp


注:本文中的QXmlStreamWriter::device方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。