本文整理汇总了C++中KPMetadata::getIptcTagString方法的典型用法代码示例。如果您正苦于以下问题:C++ KPMetadata::getIptcTagString方法的具体用法?C++ KPMetadata::getIptcTagString怎么用?C++ KPMetadata::getIptcTagString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KPMetadata
的用法示例。
在下文中一共展示了KPMetadata::getIptcTagString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getImageCaption
QString SwWindow::getImageCaption(const KPMetadata& meta) const
{
QString caption = meta.getCommentsDecoded();
if (!caption.isEmpty())
return caption;
if (meta.hasExif())
{
caption = meta.getExifComment();
if (!caption.isEmpty())
return caption;
}
if (meta.hasXmp())
{
caption = meta.getXmpTagStringLangAlt("Xmp.dc.description", QString(), false);
if (!caption.isEmpty())
return caption;
caption = meta.getXmpTagStringLangAlt("Xmp.exif.UserComment", QString(), false);
if (!caption.isEmpty())
return caption;
caption = meta.getXmpTagStringLangAlt("Xmp.tiff.ImageDescription", QString(), false);
if (!caption.isEmpty())
return caption;
}
if (meta.hasIptc())
{
caption = meta.getIptcTagString("Iptc.Application2.Caption", false);
if (!caption.isEmpty() && !caption.trimmed().isEmpty())
return caption;
}
return caption;
}
示例2: readMetadata
void IPTCEnvelope::readMetadata(QByteArray& iptcData)
{
blockSignals(true);
KPMetadata meta;
meta.setIptc(iptcData);
QString data, format, version;
QStringList list;
QDate date;
QTime time;
QString dateStr, timeStr;
d->destinationEdit->clear();
d->destinationCheck->setChecked(false);
data = meta.getIptcTagString("Iptc.Envelope.Destination", false);
if (!data.isNull())
{
d->destinationEdit->setText(data);
d->destinationCheck->setChecked(true);
}
d->destinationEdit->setEnabled(d->destinationCheck->isChecked());
d->envelopeIDEdit->clear();
d->envelopeIDCheck->setChecked(false);
data = meta.getIptcTagString("Iptc.Envelope.EnvelopeNumber", false);
if (!data.isNull())
{
d->envelopeIDEdit->setText(data);
d->envelopeIDCheck->setChecked(true);
}
d->envelopeIDEdit->setEnabled(d->envelopeIDCheck->isChecked());
d->serviceIDEdit->clear();
d->serviceIDCheck->setChecked(false);
data = meta.getIptcTagString("Iptc.Envelope.ServiceId", false);
if (!data.isNull())
{
d->serviceIDEdit->setText(data);
d->serviceIDCheck->setChecked(true);
}
d->serviceIDEdit->setEnabled(d->serviceIDCheck->isChecked());
d->unoIDEdit->clear();
d->unoIDCheck->setChecked(false);
data = meta.getIptcTagString("Iptc.Envelope.UNO", false);
if (!data.isNull())
{
d->unoIDEdit->setText(data);
d->unoIDCheck->setChecked(true);
}
d->unoIDEdit->setEnabled(d->unoIDCheck->isChecked());
d->productIDEdit->clear();
d->productIDCheck->setChecked(false);
data = meta.getIptcTagString("Iptc.Envelope.ProductId", false);
if (!data.isNull())
{
d->productIDEdit->setText(data);
d->productIDCheck->setChecked(true);
}
d->productIDEdit->setEnabled(d->productIDCheck->isChecked());
d->priorityCB->setCurrentIndex(0);
d->priorityCheck->setChecked(false);
data = meta.getIptcTagString("Iptc.Envelope.EnvelopePriority", false);
if (!data.isNull())
{
const int val = data.toInt();
if (val >= 0 && val <= 9)
{
d->priorityCB->setCurrentIndex(val);
d->priorityCheck->setChecked(true);
}
else
d->priorityCheck->setValid(false);
}
d->priorityCB->setEnabled(d->priorityCheck->isChecked());
d->formatCB->setCurrentIndex(0);
d->formatCheck->setChecked(false);
format = meta.getIptcTagString("Iptc.Envelope.FileFormat", false);
version = meta.getIptcTagString("Iptc.Envelope.FileVersion", false);
if (!format.isNull())
{
if (!version.isNull())
{
if (format.size() == 1) format.prepend("0");
//.........这里部分代码省略.........