本文整理汇总了C++中Selection::findItem方法的典型用法代码示例。如果您正苦于以下问题:C++ Selection::findItem方法的具体用法?C++ Selection::findItem怎么用?C++ Selection::findItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Selection
的用法示例。
在下文中一共展示了Selection::findItem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: serializeObjects
void Serializer::serializeObjects(const Selection& selection, SaxHandler& outputhandler)
{
Xml_attr attr;
UniqueID handler( & outputhandler );
handler.beginDoc();
handler.begin("SCRIBUSFRAGMENT", attr);
ScribusDoc* doc = selection.itemAt(0)->doc();
QMap<QString,int>::Iterator itf;
for (itf = doc->UsedFonts.begin(); itf != doc->UsedFonts.end(); ++itf)
{
attr["name"] = itf.key();
handler.beginEnd("font", attr);
}
ColorList usedColors;
doc->getUsedColors(usedColors, false);
ColorList::Iterator itc;
for (itc = usedColors.begin(); itc != usedColors.end(); ++itc)
{
Xml_attr cattr;
cattr["name"] = itc.key();
if (doc->PageColors[itc.key()].getColorModel() == colorModelRGB)
cattr["RGB"] = doc->PageColors[itc.key()].nameRGB();
else
cattr["CMYK"] = doc->PageColors[itc.key()].nameCMYK();
cattr["Spot"] = toXMLString(doc->PageColors[itc.key()].isSpotColor());
cattr["Register"] = toXMLString(doc->PageColors[itc.key()].isRegistrationColor());
handler.beginEnd("color", cattr);
}
ResourceCollection lists;
for (int i=0; i < doc->Items->count(); ++i)
doc->Items->at(i)->getNamedResources(lists);
QList<QString>::Iterator it;
QList<QString> names = lists.styleNames();
for (it = names.begin(); it != names.end(); ++it)
doc->paragraphStyles().get(*it).saxx(handler);
names = lists.charStyleNames();
for (it = names.begin(); it != names.end(); ++it)
doc->charStyles().get(*it).saxx(handler);
names = lists.lineStyleNames();
for (it = names.begin(); it != names.end(); ++it)
{
Xml_attr multiattr;
multiattr["Name"] = *it;
handler.begin("MultiLine", multiattr);
multiLine ml = doc->MLineStyles[*it];
multiLine::Iterator itMU2;
for (itMU2 = ml.begin(); itMU2 != ml.end(); ++itMU2)
{
Xml_attr lineattr;
lineattr["Color"] = (*itMU2).Color;
lineattr["Shade"] = toXMLString((*itMU2).Shade);
lineattr["Dash"] = toXMLString((*itMU2).Dash);
lineattr["LineEnd"] = toXMLString((*itMU2).LineEnd);
lineattr["LineJoin"] = toXMLString((*itMU2).LineJoin);
lineattr["Width"] = toXMLString((*itMU2).Width);
handler.beginEnd("SubLine", lineattr);
}
handler.end("MultiLine");
}
/* names = lists.patterns();
for (it = names.begin(); it != names.end(); ++it)
doc->patterns[*it].saxx(handler);
*/
/*
QStringList patterns = doc->getUsedPatternsSelection((Selection*)&selection);
for (int c = 0; c < patterns.count(); ++c)
{
ScPattern& pa = doc->docPatterns[patterns[c]];
Xml_attr cattr;
cattr["Name"] = patterns[c];
cattr["scaleX"] = toXMLString(pa.scaleX);
cattr["scaleY"] = toXMLString(pa.scaleY);
cattr["width"] = toXMLString(pa.width);
cattr["height"] = toXMLString(pa.height);
cattr["xoffset"] = toXMLString(pa.xoffset);
cattr["yoffset"] = toXMLString(pa.yoffset);
handler.begin("Pattern", cattr);
for (int o = 0; o < pa.items.count(); o++)
{
pa.items.at(o)->saxx(handler);
}
handler.end("Pattern");
}
*/
for (int i=0; i < doc->Items->count(); ++i)
{
int k = selection.findItem(doc->Items->at(i));
if (k >=0)
doc->Items->at(i)->saxx(handler);
}
//.........这里部分代码省略.........