本文整理汇总了C++中QSvgNode::requiredFonts方法的典型用法代码示例。如果您正苦于以下问题:C++ QSvgNode::requiredFonts方法的具体用法?C++ QSvgNode::requiredFonts怎么用?C++ QSvgNode::requiredFonts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QSvgNode
的用法示例。
在下文中一共展示了QSvgNode::requiredFonts方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void QSvgSwitch::draw(QPainter *p, QSvgExtraStates &states)
{
QList<QSvgNode*>::iterator itr = m_renderers.begin();
applyStyle(p, states);
while (itr != m_renderers.end()) {
QSvgNode *node = *itr;
if (node->isVisible() && (node->displayMode() != QSvgNode::NoneMode)) {
const QStringList &features = node->requiredFeatures();
const QStringList &extensions = node->requiredExtensions();
const QStringList &languages = node->requiredLanguages();
const QStringList &formats = node->requiredFormats();
const QStringList &fonts = node->requiredFonts();
bool okToRender = true;
if (!features.isEmpty()) {
QStringList::const_iterator sitr = features.constBegin();
for (; sitr != features.constEnd(); ++sitr) {
if (!isSupportedSvgFeature(*sitr)) {
okToRender = false;
break;
}
}
}
if (okToRender && !extensions.isEmpty()) {
QStringList::const_iterator sitr = extensions.constBegin();
for (; sitr != extensions.constEnd(); ++sitr) {
if (!isSupportedSvgExtension(*sitr)) {
okToRender = false;
break;
}
}
}
if (okToRender && !languages.isEmpty()) {
QStringList::const_iterator sitr = languages.constBegin();
okToRender = false;
for (; sitr != languages.constEnd(); ++sitr) {
if ((*sitr).startsWith(m_systemLanguagePrefix)) {
okToRender = true;
break;
}
}
}
if (okToRender && !formats.isEmpty()) {
okToRender = false;
}
if (okToRender && !fonts.isEmpty()) {
okToRender = false;
}
if (okToRender) {
node->draw(p, states);
break;
}
}
++itr;
}
revertStyle(p, states);
}