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


C++ QXmlStreamAttributes::append方法代码示例

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


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

示例1: graphicAttributes

 QXmlStreamAttributes Arrow::graphicAttributes() const
 {
   QXmlStreamAttributes attributes ;
   attributes.append("arrowType", QString::number(d->arrowType)) ;
   attributes.append("splineDisabled", QString::number(!d->spline));
   return attributes ;
 }
开发者ID:hvennekate,项目名称:Molsketch,代码行数:7,代码来源:arrow.cpp

示例2:

QXmlStreamAttributes NormalizeFilter2D::exportFilterSettingsXML()
{
    QXmlStreamAttributes attributes;
    attributes.append("autoLimits", QString::number(this->autoLimits));
    attributes.append("lowerLimit", QString::number(this->lowerLimit));
    attributes.append("upperLimit", QString::number(this->upperLimit));
    return attributes;
}
开发者ID:voxie-viewer,项目名称:voxie,代码行数:8,代码来源:normalizefilter2d.cpp

示例3: save

void CameraManager::save(QXmlStreamWriter& writer) {
   
    writer.writeStartElement("Camera"); // root element start

    writer.writeStartElement("input size"); // element1 start
    QXmlStreamAttributes inputSizes;
    inputSizes.append("width", QtUtil::toQString(_size.width));
    inputSizes.append("height", QtUtil::toQString(_size.width));
    writer.writeAttributes(inputSizes);
    writer.writeEndElement(); // element1 end

    writer.writeEndElement(); // root end
  
}
开发者ID:uejun,项目名称:FoodAR,代码行数:14,代码来源:cameraManager.cpp

示例4: writeScreenieScene

bool XmlScreenieSceneDao::writeScreenieScene(const ScreenieScene &screenieScene, ScreenieSceneSerializer::Mode mode)
{
    bool result = true;
    d->streamWriter->writeDTD("<!DOCTYPE screenie>");
    d->streamWriter->writeStartElement("screeniescene");

    QXmlStreamAttributes sceneAttributes;
    sceneAttributes.append("version", d->version.toString());
    sceneAttributes.append("template", screenieScene.isTemplate() ? "true" : "false");
    d->streamWriter->writeAttributes(sceneAttributes);
    {
        switch (mode) {
        case ScreenieSceneSerializer::FullScene:
            d->streamWriter->writeStartElement("background");
            {
                QXmlStreamAttributes backgroundAttributes;
                backgroundAttributes.append("enabled", screenieScene.isBackgroundEnabled() ? "true" : "false");
                backgroundAttributes.append("bgcolor", screenieScene.getBackgroundColor().name());
                d->streamWriter->writeAttributes(backgroundAttributes);
            }
            d->streamWriter->writeEndElement();
            result = writeScreenieModels(screenieScene, mode);
            break;
        case ScreenieSceneSerializer::SelectedItems:
            result = writeScreenieModels(screenieScene, mode);
            break;
        default:
#ifdef DEBUG
            qCritical("XmlScreenieSceneDao::writeScreenieScene: UNSUPPORTED mode: %d", mode);
#endif
            result = false;
        }
    }
    d->streamWriter->writeEndElement();
    return result;
}
开发者ID:CharuChopra84,项目名称:screenie,代码行数:36,代码来源:XmlScreenieSceneDao.cpp

示例5: writeParagraphStyle

bool OdtWriter::writeParagraphStyle(const QTextBlockFormat& format, const QString& name)
{
	QXmlStreamAttributes attributes;
	bool rtl = format.layoutDirection() == Qt::RightToLeft;
	if (rtl) {
		attributes.append(QString::fromLatin1("style:writing-mode"), QString::fromLatin1("rl"));
	}

	Qt::Alignment align = format.alignment();
	if (rtl && (align & Qt::AlignLeft)) {
		attributes.append(QString::fromLatin1("fo:text-align"), QString::fromLatin1("left"));
	} else if (align & Qt::AlignRight) {
		attributes.append(QString::fromLatin1("fo:text-align"), QString::fromLatin1("right"));
	} else if (align & Qt::AlignCenter) {
		attributes.append(QString::fromLatin1("fo:text-align"), QString::fromLatin1("center"));
	} else if (align & Qt::AlignJustify) {
		attributes.append(QString::fromLatin1("fo:text-align"), QString::fromLatin1("justify"));
	}

	if (format.indent() > 0) {
		attributes.append(QString::fromLatin1("fo:margin-left"), QString::number(format.indent() * 0.5) + QString::fromLatin1("in"));
	}

	if (attributes.isEmpty()) {
		return false;
	}

	m_xml.writeStartElement(QString::fromLatin1("style:style"));
	m_xml.writeAttribute(QString::fromLatin1("style:name"), name);
	m_xml.writeAttribute(QString::fromLatin1("style:family"), QString::fromLatin1("paragraph"));
	m_xml.writeAttribute(QString::fromLatin1("style:parent-style-name"), QString::fromLatin1("Normal"));

	m_xml.writeEmptyElement(QString::fromLatin1("style:paragraph-properties"));
	m_xml.writeAttributes(attributes);
	m_xml.writeEndElement();

	return true;
}
开发者ID:olivierkes,项目名称:focuswriter,代码行数:38,代码来源:odt_writer.cpp

示例6: writeTextStyle

bool OdtWriter::writeTextStyle(const QTextCharFormat& format, const QString& name)
{
	QXmlStreamAttributes attributes;
	if (format.fontWeight() == QFont::Bold) {
		attributes.append(QString::fromLatin1("fo:font-weight"), QString::fromLatin1("bold"));
	}
	if (format.fontItalic()) {
		attributes.append(QString::fromLatin1("fo:font-style"), QString::fromLatin1("italic"));
	}
	if (format.fontUnderline()) {
		attributes.append(QString::fromLatin1("style:text-underline-type"), QString::fromLatin1("single"));
		attributes.append(QString::fromLatin1("style:text-underline-style"), QString::fromLatin1("solid"));
	}
	if (format.fontStrikeOut()) {
		attributes.append(QString::fromLatin1("style:text-line-through-type"), QString::fromLatin1("single"));
	}
	if (format.verticalAlignment() == QTextCharFormat::AlignSuperScript) {
		attributes.append(QString::fromLatin1("style:text-position"), QString::fromLatin1("super"));
	} else if (format.verticalAlignment() == QTextCharFormat::AlignSubScript) {
		attributes.append(QString::fromLatin1("style:text-position"), QString::fromLatin1("sub"));
	}

	if (attributes.isEmpty()) {
		return false;
	}

	m_xml.writeStartElement(QString::fromLatin1("style:style"));
	m_xml.writeAttribute(QString::fromLatin1("style:name"), name);
	m_xml.writeAttribute(QString::fromLatin1("style:family"), QString::fromLatin1("text"));

	m_xml.writeEmptyElement(QString::fromLatin1("style:text-properties"));
	m_xml.writeAttributes(attributes);
	m_xml.writeEndElement();

	return true;
}
开发者ID:olivierkes,项目名称:focuswriter,代码行数:36,代码来源:odt_writer.cpp

示例7: sipReleaseType

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

    {
        const QString* a0;
        int a0State = 0;
        const QString* a1;
        int a1State = 0;
        const QString* a2;
        int a2State = 0;
        QXmlStreamAttributes *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1J1J1", &sipSelf, sipType_QXmlStreamAttributes, &sipCpp, sipType_QString,&a0, &a0State, sipType_QString,&a1, &a1State, sipType_QString,&a2, &a2State))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->append(*a0,*a1,*a2);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<QString *>(a0),sipType_QString,a0State);
            sipReleaseType(const_cast<QString *>(a1),sipType_QString,a1State);
            sipReleaseType(const_cast<QString *>(a2),sipType_QString,a2State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    {
        const QString* a0;
        int a0State = 0;
        const QString* a1;
        int a1State = 0;
        QXmlStreamAttributes *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1J1", &sipSelf, sipType_QXmlStreamAttributes, &sipCpp, sipType_QString,&a0, &a0State, sipType_QString,&a1, &a1State))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->append(*a0,*a1);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<QString *>(a0),sipType_QString,a0State);
            sipReleaseType(const_cast<QString *>(a1),sipType_QString,a1State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    {
        const QXmlStreamAttribute* a0;
        QXmlStreamAttributes *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ9", &sipSelf, sipType_QXmlStreamAttributes, &sipCpp, sipType_QXmlStreamAttribute, &a0))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp->append(*a0);
            Py_END_ALLOW_THREADS

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_QXmlStreamAttributes, sipName_append, doc_QXmlStreamAttributes_append);

    return NULL;
}
开发者ID:annelida,项目名称:stuff,代码行数:67,代码来源:sipQtCoreQXmlStreamAttributes.cpp

示例8: applyTranslationToXMIFile

bool applyTranslationToXMIFile(const char *fileName, const QStringList &attributes, TranslationMap &translations)
{

    QFile file(fileName);
    if (!file.open(QIODevice::ReadOnly))
        return false;
    QXmlStreamReader reader(&file);
    QFile outFile;
    if (!outFile.open(stdout, QIODevice::WriteOnly))
        return false;
    QXmlStreamWriter writer(&outFile);
    writer.setAutoFormatting (true);
    writer.setAutoFormattingIndent(1);
    writer.setCodec(reader.documentEncoding().toLatin1().constData());

    while (!reader.atEnd())
    {
        QXmlStreamReader::TokenType type = reader.readNext();
        switch(type)
        {
        case QXmlStreamReader::ProcessingInstruction:
            writer.writeProcessingInstruction(reader.processingInstructionTarget().toString(), reader.processingInstructionData().toString());
            break;

        case QXmlStreamReader::DTD:
            writer.writeDTD(reader.text().toString());
            break;

        case QXmlStreamReader::StartDocument:
            writer.writeStartDocument(reader.documentVersion().toString());
            break;

        case QXmlStreamReader::StartElement:
        {
            writer.writeStartElement(reader.namespaceUri().toString(), reader.name().toString());
            if (reader.namespaceDeclarations().size() > 0)
            {
                QXmlStreamNamespaceDeclaration ns = reader.namespaceDeclarations().first();
                writer.writeNamespace(ns.namespaceUri().toString(), ns.prefix().toString());
            }
            QXmlStreamAttributes writerAttributes;
            for(int index = 0; index < reader.attributes().size(); index++)
            {
                QXmlStreamAttribute attr = reader.attributes()[index];
                QString name = attr.qualifiedName().toString();
                if (!attributes.contains(name)) {
                    writerAttributes.append(attr);
                    continue;
                }
                QString value = attr.value().toString();
                if (value.isEmpty()) {
                    writerAttributes.append(attr);
                    continue;
                }
                if (!translations.contains(value))
                {
                    cerr << "could not find translation for attribute '" << qPrintable(name) << "':'" << qPrintable(value) << "'" << std::endl;
                    continue;
                }
                QString newValue = translations[value];
                if (newValue.isEmpty()) {
                    writerAttributes.append(attr);
                    continue;
                }
                //cerr << name.toUtf8().data() << ":" << value.toUtf8().data() << "->" << newValue.toUtf8().data() << endl;
                QXmlStreamAttribute newAttribute(name, newValue);
                writerAttributes.append(newAttribute);
                //qDebug() << writerAttributes;
            }
            writer.writeAttributes(writerAttributes);
            //QString content = xmlReader.readElementText(QXmlStreamReader::SkipChildElements);
            //writer.writeCharacters(content);
            break;
        }

        case QXmlStreamReader::Characters:
            writer.writeCharacters(reader.text().toString());
            break;

        case QXmlStreamReader::Comment:
            writer.writeComment(reader.text().toString());
            break;

        case QXmlStreamReader::EndElement:
            writer.writeEndElement();
            break;

        case QXmlStreamReader::EndDocument:
           writer.writeEndDocument();
           break;

        default:
            break;
        }

    }
    outFile.close();
    return true;
}
开发者ID:Nephos,项目名称:umbrello,代码行数:99,代码来源:shared.cpp

示例9: writeXml

void LapTimerThread::writeXml()
{
    QXmlStreamReader xmlReader;
    coordTmpFile.open(QIODevice::ReadOnly | QIODevice::Text);
    xmlReader.setDevice(&coordTmpFile);
    xmlReader.readNext();
    int lapNum=0;
    //Reading from the file
    xmlReader.readNext();
    while (!xmlReader.isEndDocument())
    {
        if (xmlReader.isStartElement())
        {
            QString name = xmlReader.name().toString();
            if (name == "lap")
            {
                lapNum++;
            }

        }
        else if (xmlReader.isEndElement())
        {

        }
        xmlReader.readNext();
    }
    coordTmpFile.close();
    for (int i=0;i<lapNum-1;i++)// loop to generate kml file for each lap
    {

    QFile xmlKmlFile;
    QXmlStreamWriter bufferKml;

    xmlKmlFile.setFileName("data/"+dirName+"/"+dirName+"-"+QString::number(i+1)+".kml");
    xmlKmlFile.open(QIODevice::WriteOnly | QIODevice::Text);
    bufferKml.setDevice(&xmlKmlFile);
    bufferKml.setAutoFormatting(true);
    bufferKml.writeStartDocument();

    bufferKml.writeStartElement("kml");
    QXmlStreamAttributes atrr;
    atrr.append("xmlns","http://www.opengis.net/kml/2.2");
    atrr.append("xmlns:gx","http://www.google.com/kml/ext/2.2");
    atrr.append("xmlns:atom","http://www.w3.org/2005/Atom");
    bufferKml.writeAttributes(atrr);
    bufferKml.writeStartElement("Document");
    bufferKml.writeTextElement("open","1");
    bufferKml.writeTextElement("visibility","1");
    bufferKml.writeStartElement("name");
    bufferKml.writeCDATA("GPS Lap Timer - KML Log - "+QDate::currentDate().toString("yyyyMMdd")+QTime::currentTime().toString("hhmmss"));
    bufferKml.writeEndElement();
    //style - track
    bufferKml.writeStartElement("Style");
    bufferKml.writeAttribute(QXmlStreamAttribute("id","track"));
    bufferKml.writeStartElement("LineStyle");
    bufferKml.writeTextElement("color","7f0000ff");
    bufferKml.writeTextElement("width","4");
    bufferKml.writeEndElement();
    bufferKml.writeStartElement("IconStyle");
    bufferKml.writeTextElement("scale","1.3");
    bufferKml.writeStartElement("Icon");
    bufferKml.writeTextElement("href","http://earth.google.com/images/kml-icons/track-directional/track-0.png");
    bufferKml.writeEndElement();
    bufferKml.writeEndElement();
    bufferKml.writeEndElement();
    //style - start
    bufferKml.writeStartElement("Style");
    bufferKml.writeAttribute(QXmlStreamAttribute("id","start"));
    bufferKml.writeStartElement("IconStyle");
    bufferKml.writeTextElement("scale","1.3");
    bufferKml.writeStartElement("Icon");
    bufferKml.writeTextElement("href","http://maps.google.com/mapfiles/kml/paddle/grn-circle.png");
    bufferKml.writeEndElement();
    bufferKml.writeEmptyElement("hotSpot");
    atrr.clear();
    atrr.append("x","32");
    atrr.append("y","1");
    atrr.append("xunits","pixels");
    atrr.append("yunits","pixels");
    bufferKml.writeAttributes(atrr);
    bufferKml.writeEndElement();
    bufferKml.writeEndElement();
    // style - end
    bufferKml.writeStartElement("Style");
    bufferKml.writeAttribute(QXmlStreamAttribute("id","end"));
    bufferKml.writeStartElement("IconStyle");
    bufferKml.writeTextElement("scale","1.3");
    bufferKml.writeStartElement("Icon");
    bufferKml.writeTextElement("href","http://maps.google.com/mapfiles/kml/paddle/red-circle.png");
    bufferKml.writeEndElement();
    bufferKml.writeEmptyElement("hotSpot");
    bufferKml.writeAttributes(atrr);
    bufferKml.writeEndElement();
    bufferKml.writeEndElement();
    // style - statistics
    bufferKml.writeStartElement("Style");
    bufferKml.writeAttribute(QXmlStreamAttribute("id","statistics"));
    bufferKml.writeStartElement("IconStyle");
    bufferKml.writeTextElement("scale","1.3");
    bufferKml.writeStartElement("Icon");
//.........这里部分代码省略.........
开发者ID:qhr1993,项目名称:GPSLapTimer,代码行数:101,代码来源:laptimerthread.cpp

示例10: xmlAttributes

 QXmlStreamAttributes SettingsItem::xmlAttributes() const {
   QXmlStreamAttributes result;
   result.append(XML_VALUE_ATTRIBUTE, serialize());
   return result;
 }
开发者ID:hvennekate,项目名称:Molsketch,代码行数:5,代码来源:settingsitem.cpp

示例11:

QXmlStreamAttributes GaussFilter2D::exportFilterSettingsXML()
{
    QXmlStreamAttributes attributes;
    attributes.append("radius", QString::number(this->radius));
    return attributes;
}
开发者ID:voxie-viewer,项目名称:voxie,代码行数:6,代码来源:gaussfilter2d.cpp

示例12: GetImportOpmlFile

			QString FirefoxProfileSelectPage::GetImportOpmlFile ()
			{
				QString rssSql ("SELECT ann.id, ann.item_id, ann.anno_attribute_id, ann.content,"
						"bm.title FROM moz_items_annos ann,moz_bookmarks bm WHERE ann.item_id"
						" IN (SELECT item_id FROM moz_items_annos WHERE anno_attribute_id = (SELECT"
						" id FROM moz_anno_attributes WHERE name = 'livemark/feedURI')) AND ("
						"ann.anno_attribute_id = 4 OR ann.anno_attribute_id = 5) AND "
						"bm.id = ann.item_id");
				QSqlQuery rssQuery = GetQuery (rssSql);

				if (rssQuery.isValid ())
				{
					QSqlQuery query (*DB_);
					query.exec ("SELECT id FROM moz_anno_attributes WHERE name='livemark/siteURI'");
					query.next ();
					int site = query.value (0).toInt ();
					query.exec ("SELECT id FROM moz_anno_attributes WHERE name='livemark/feedURI'");
					query.next ();
					int feed = query.value (0).toInt ();

					QList<QVariant> opmlData;
					int prevItemId = -1;

					QMap<QString, QVariant> omplLine;
					do
					{
						if (rssQuery.value (2).toInt () == site)
							omplLine ["SiteUrl"] = rssQuery.value (3).toString ();
						if (rssQuery.value (2).toInt () == feed)
							omplLine ["FeedUrl"] = rssQuery.value (3).toString ();						
						if (prevItemId == rssQuery.value (1).toInt ())
							opmlData.push_back (omplLine);
						else
						{
							prevItemId = rssQuery.value (1).toInt ();
							omplLine ["Title"] = rssQuery.value (4).toString ();
						}
					}
					while (rssQuery.next ());
					QFile file ("firefox.opml");
					if (file.open (QIODevice::WriteOnly))
					{
						QXmlStreamWriter streamWriter (&file);
						streamWriter.setAutoFormatting (true);
						streamWriter.writeStartDocument ();
						streamWriter.writeStartElement ("opml");
						streamWriter.writeAttribute ("version", "1.0");
						streamWriter.writeStartElement ("head");
						streamWriter.writeStartElement ("text");
						streamWriter.writeEndElement ();
						streamWriter.writeEndElement ();
						streamWriter.writeStartElement ("body");
						streamWriter.writeStartElement ("outline");
						streamWriter.writeAttribute ("text", "Live Bookmarks");
						Q_FOREACH (const QVariant& hRowVar, opmlData)
						{
							streamWriter.writeStartElement ("outline");
							QMap<QString, QVariant> hRow = hRowVar.toMap ();
							QXmlStreamAttributes attr;
							attr.append ("title", hRow ["Title"].toString ());
							attr.append ("htmlUrl", hRow ["SiteUrl"].toString ());
							attr.append ("xmlUrl", hRow ["FeedUrl"].toString ());
							attr.append ("text", hRow ["Title"].toString ());
							streamWriter.writeAttributes (attr);
							streamWriter.writeEndElement ();
						}
开发者ID:Zereal,项目名称:leechcraft,代码行数:66,代码来源:firefoxprofileselectpage.cpp


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