本文整理汇总了C++中FilterAction::identifier方法的典型用法代码示例。如果您正苦于以下问题:C++ FilterAction::identifier方法的具体用法?C++ FilterAction::identifier怎么用?C++ FilterAction::identifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FilterAction
的用法示例。
在下文中一共展示了FilterAction::identifier方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
QString DImgFilterManager::i18nDisplayableName(const FilterAction& action)
{
if (action.displayableName().isEmpty() && action.identifier().isEmpty())
{
return i18n("Unknown filter");
}
else
{
QString i18nDispName = i18nDisplayableName(action.identifier());
QString metadataDispName = action.displayableName();
if (!i18nDispName.isEmpty())
{
return i18nDispName;
}
else if (!metadataDispName.isEmpty())
{
return metadataDispName;
}
else
{
return action.identifier();
}
}
}
示例2: filterIcon
QString DImgFilterManager::filterIcon(const FilterAction& action)
{
QString iconName = filterIcon(action.identifier());
if (!iconName.isNull())
{
return iconName;
}
return QLatin1String("document-edit");
}
示例3: filterActionTipContents
QString ToolTipFiller::filterActionTipContents(const FilterAction& action)
{
if (action.isNull())
{
return QString();
}
QString str;
DToolTipStyleSheet cnt(ApplicationSettings::instance()->getToolTipsFont());
QString tip = cnt.tipHeader;
tip += cnt.headBeg + i18n("Filter") + cnt.headEnd;
// Displayable name
tip += cnt.cellBeg + i18n("Name:") + cnt.cellMid
+ DImgFilterManager::instance()->i18nDisplayableName(action) + cnt.cellEnd;
// Category
QString reproducible("---");
switch (action.category())
{
case FilterAction::ReproducibleFilter:
reproducible = i18nc("Image filter reproducible: Yes", "Yes");
break;
case FilterAction::ComplexFilter:
reproducible = i18nc("Image filter reproducible: Partially", "Partially");
break;
case FilterAction::DocumentedHistory:
reproducible = i18nc("Image filter reproducible: No", "No");
break;
default:
break;
};
tip += cnt.cellBeg + i18n("Reproducible:") + cnt.cellMid
+ reproducible + cnt.cellEnd;
// Description
str = action.description();
if (str.isEmpty())
{
str = QString("---");
}
tip += cnt.cellSpecBeg + i18nc("Image filter description", "Description:") + cnt.cellSpecMid
+ cnt.breakString(str) + cnt.cellSpecEnd;
// Identifier + version
tip += cnt.cellBeg + i18n("Identifier:") + cnt.cellMid
+ action.identifier() + " (v" + QString::number(action.version()) + ") " + cnt.cellEnd;
if (action.hasParameters())
{
tip += cnt.headBeg + i18n("Technical Parameters") + cnt.headEnd;
const QHash<QString, QVariant>& params = action.parameters();
QList<QString> keys = params.keys();
qSort(keys);
foreach(const QString& key, keys)
{
QHash<QString, QVariant>::const_iterator it;
for (it = params.find(key); it != params.end() && it.key() == key; ++it)
{
if (it.key().isEmpty() || !it.value().isValid())
{
continue;
}
if (it.key().startsWith(QLatin1String("curveData")))
{
str = i18n("<i>Binary Data</i>");
}
else
{
str = it.value().toString();
}
if (str.length() > cnt.maxStringLength)
{
str = cnt.elidedText(str, Qt::ElideRight);
}
QString key = it.key();
QChar first = key.at(0);
if (first.isLower())
{
key.replace(0, 1, first.toUpper());
}
tip += cnt.cellBeg + key + cnt.cellMid
+ str + cnt.cellEnd;
}
}
示例4: setAction
void DImgBuiltinFilter::setAction(const FilterAction& action)
{
m_type = NoOperation;
if (action.identifier() == "transform:rotate" && action.version() == 1)
{
int angle = action.parameter("angle").toInt();
if (angle == 90)
{
m_type = Rotate90;
}
else if (angle == 180)
{
m_type = Rotate180;
}
else
{
m_type = Rotate270;
}
}
else if (action.identifier() == "transform:flip" && action.version() == 1)
{
QString direction = action.parameter("direction").toString();
if (direction == "vertical")
{
m_type = FlipVertically;
}
else
{
m_type = FlipHorizontally;
}
}
else if (action.identifier() == "transform:crop" && action.version() == 1)
{
m_type = Crop;
int x = action.parameter("x").toInt();
int y = action.parameter("y").toInt();
int width = action.parameter("width").toInt();
int height = action.parameter("height").toInt();
m_arg = QRect(x, y, width, height);
}
else if (action.identifier() == "transform:resize" && action.version() == 1)
{
m_type = Resize;
int width = action.parameter("width").toInt();
int height = action.parameter("height").toInt();
m_arg = QSize(width, height);
}
else if (action.identifier() == "transform:convertDepth" && action.version() == 1)
{
int depth = action.parameter("depth").toInt();
if (depth == 16)
{
m_type = ConvertTo16Bit;
}
else
{
m_type = ConvertTo8Bit;
}
}
}