本文整理汇总了C++中Painter::foregroundFill方法的典型用法代码示例。如果您正苦于以下问题:C++ Painter::foregroundFill方法的具体用法?C++ Painter::foregroundFill怎么用?C++ Painter::foregroundFill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Painter
的用法示例。
在下文中一共展示了Painter::foregroundFill方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fromXML
Painter Painter::fromXML(const QDomElement& e, QString filename)
{
Painter FP;
if (e.hasAttribute("zoomUnder") || e.hasAttribute("zoomUpper"))
FP.zoomBoundary(e.attribute("zoomUnder","0").toDouble(),e.attribute("zoomUpper","10e6").toDouble());
if (e.hasAttribute("foregroundColor"))
{
FP.foreground(
toColor(e.attribute("foregroundColor")),e.attribute("foregroundScale").toDouble(),e.attribute("foregroundOffset").toDouble());
if (e.hasAttribute("foregroundDashDown"))
FP.foregroundDash(e.attribute("foregroundDashDown").toDouble(),e.attribute("foregroundDashUp").toDouble());
}
if (e.hasAttribute("fillWithIcon"))
FP.foregroundUseIcon(e.attribute("fillWithIcon") == "yes");
if (e.hasAttribute("backgroundColor"))
FP.background(
toColor(e.attribute("backgroundColor")),e.attribute("backgroundScale").toDouble(),e.attribute("backgroundOffset").toDouble());
if (e.attribute("interior") == "yes")
FP.BackgroundInterior = true;
if (e.attribute("exterior") == "yes")
FP.BackgroundExterior = true;
if (e.hasAttribute("touchupColor"))
{
FP.touchup(
toColor(e.attribute("touchupColor")),e.attribute("touchupScale").toDouble(),e.attribute("touchupOffset").toDouble());
if (e.hasAttribute("touchupDashDown"))
FP.touchupDash(e.attribute("touchupDashDown").toDouble(),e.attribute("touchupDashUp").toDouble());
}
if (e.hasAttribute("fillColor"))
FP.foregroundFill(toColor(e.attribute("fillColor")));
if (e.hasAttribute("icon"))
{
QString iconFilename = e.attribute("icon");
if (!QFileInfo(iconFilename).isAbsolute())
iconFilename = QFileInfo(filename).absolutePath().append("/").append(iconFilename);
FP.setIcon(iconFilename,e.attribute("iconScale", "0.0").toDouble(),e.attribute("iconOffset", "0.0").toDouble());
}
if (e.attribute("drawTrafficDirectionMarks") == "yes")
FP.drawTrafficDirectionMarks(true);
if (e.hasAttribute("trafficDirectionMarksColor"))
FP.TrafficDirectionMarksColor = toColor((e.attribute("trafficDirectionMarksColor")));
if (e.hasAttribute("labelColor"))
{
FP.label(
toColor(e.attribute("labelColor")),e.attribute("labelScale").toDouble(),e.attribute("labelOffset").toDouble());
FP.setLabelFont(e.attribute("labelFont"));
FP.labelTag(e.attribute("labelTag"));
if (e.hasAttribute("labelHalo"))
FP.labelHalo((e.attribute("labelHalo") == "yes"));
if (e.hasAttribute("labelArea"))
FP.labelArea((e.attribute("labelArea") == "yes"));
if (e.hasAttribute("labelBackgroundColor"))
FP.labelBackground(toColor(e.attribute("labelBackgroundColor")));
if (e.hasAttribute("labelBackgroundTag"))
FP.labelBackgroundTag(e.attribute("labelBackgroundTag"));
}
QDomNode n = e.firstChild();
QList<QPair<QString,QString> > Pairs;
while (!n.isNull())
{
if (n.isElement())
{
QDomElement t = n.toElement();
if (t.tagName() == "selector")
{
if (!t.attribute("key").isEmpty())
Pairs.push_back(qMakePair(t.attribute("key"),t.attribute("value")));
else
{
FP.setSelector(t.attribute("expr"));
return FP;
}
}
}
n = n.nextSibling();
}
if (Pairs.size() == 1)
FP.setSelector(Pairs[0].first+"="+Pairs[0].second);
else if (Pairs.size())
{
bool Same = true;
for (int i=1; i<Pairs.size(); ++i)
if (Pairs[0].first != Pairs[i].first)
Same = false;
if (Same)
{
QStringList Options;
for (int i=0; i<Pairs.size(); ++i)
Options.push_back(Pairs[i].second);
FP.setSelector("["+ Pairs[0].first +"] isoneof ("+ Options.join(",") + ")");
}
else
{
QStringList Options;
for (int i=0; i<Pairs.size(); ++i)
Options.push_back(Pairs[i].first+"="+Pairs[i].second);
FP.setSelector(Options.join(" or "));
}
//.........这里部分代码省略.........