本文整理汇总了C++中KPMetadata::setIptc方法的典型用法代码示例。如果您正苦于以下问题:C++ KPMetadata::setIptc方法的具体用法?C++ KPMetadata::setIptc怎么用?C++ KPMetadata::setIptc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KPMetadata
的用法示例。
在下文中一共展示了KPMetadata::setIptc方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
void XMPEditWidget::apply()
{
if (d->modified && !d->isReadOnly)
{
KPImageInfo info(*d->dlg->currentItem());
if (d->contentPage->syncHOSTCommentIsChecked())
{
info.setDescription(d->contentPage->getXMPCaption());
}
d->contentPage->applyMetadata(d->exifData, d->xmpData);
if (d->originPage->syncHOSTDateIsChecked())
{
info.setDate(d->originPage->getXMPCreationDate());
}
d->originPage->applyMetadata(d->exifData, d->xmpData);
d->subjectsPage->applyMetadata(d->xmpData);
d->keywordsPage->applyMetadata(d->xmpData);
d->categoriesPage->applyMetadata(d->xmpData);
d->creditsPage->applyMetadata(d->xmpData);
d->statusPage->applyMetadata(d->xmpData);
d->propertiesPage->applyMetadata(d->xmpData);
KPMetadata meta;
meta.load((*d->dlg->currentItem()).path());
meta.setExif(d->exifData);
meta.setIptc(d->iptcData);
meta.setXmp(d->xmpData);
meta.save((*d->dlg->currentItem()).path());
d->modified = false;
}
}
示例2: applyMetadata
void IPTCSubjects::applyMetadata(QByteArray& iptcData)
{
KPMetadata meta;
meta.setIptc(iptcData);
QStringList newSubjects = subjectsList();
if (m_subjectsCheck->isChecked())
meta.setIptcSubjects(meta.getIptcSubjects(), newSubjects);
else
meta.setIptcSubjects(meta.getIptcSubjects(), QStringList());
iptcData = meta.getIptc();
}
示例3: applyMetadata
void IPTCKeywords::applyMetadata(QByteArray& iptcData)
{
KPMetadata meta;
meta.setIptc(iptcData);
QStringList newKeywords;
for (int i = 0 ; i < d->keywordsBox->count(); ++i)
{
QListWidgetItem* item = d->keywordsBox->item(i);
newKeywords.append(item->text());
}
if (d->keywordsCheck->isChecked())
meta.setIptcKeywords(d->oldKeywords, newKeywords);
else
meta.setIptcKeywords(d->oldKeywords, QStringList());
iptcData = meta.getIptc();
}
示例4: readMetadata
void IPTCKeywords::readMetadata(QByteArray& iptcData)
{
blockSignals(true);
KPMetadata meta;
meta.setIptc(iptcData);
d->oldKeywords = meta.getIptcKeywords();
d->keywordsBox->clear();
d->keywordsCheck->setChecked(false);
if (!d->oldKeywords.isEmpty())
{
d->keywordsBox->insertItems(0, d->oldKeywords);
d->keywordsCheck->setChecked(true);
}
d->keywordEdit->setEnabled(d->keywordsCheck->isChecked());
d->keywordsBox->setEnabled(d->keywordsCheck->isChecked());
d->addKeywordButton->setEnabled(d->keywordsCheck->isChecked());
d->delKeywordButton->setEnabled(d->keywordsCheck->isChecked());
blockSignals(false);
}
示例5: applyMetadata
void IPTCEnvelope::applyMetadata(QByteArray& iptcData)
{
KPMetadata meta;
meta.setIptc(iptcData);
if (d->destinationCheck->isChecked())
{
meta.setIptcTagString("Iptc.Envelope.Destination", d->destinationEdit->toPlainText());
}
else
{
meta.removeIptcTag("Iptc.Envelope.Destination");
}
if (d->envelopeIDCheck->isChecked())
{
meta.setIptcTagString("Iptc.Envelope.EnvelopeNumber", d->envelopeIDEdit->text());
}
else
{
meta.removeIptcTag("Iptc.Envelope.EnvelopeNumber");
}
if (d->serviceIDCheck->isChecked())
{
meta.setIptcTagString("Iptc.Envelope.ServiceId", d->serviceIDEdit->text());
}
else
{
meta.removeIptcTag("Iptc.Envelope.ServiceId");
}
if (d->unoIDCheck->isChecked())
{
meta.setIptcTagString("Iptc.Envelope.UNO", d->unoIDEdit->text());
}
else
{
meta.removeIptcTag("Iptc.Envelope.UNO");
}
if (d->productIDCheck->isChecked())
{
meta.setIptcTagString("Iptc.Envelope.ProductId", d->productIDEdit->text());
}
else
{
meta.removeIptcTag("Iptc.Envelope.ProductId");
}
if (d->priorityCheck->isChecked())
{
meta.setIptcTagString("Iptc.Envelope.EnvelopePriority", QString::number(d->priorityCB->currentIndex()));
}
else if (d->priorityCheck->isValid())
{
meta.removeIptcTag("Iptc.Envelope.EnvelopePriority");
}
if (d->formatCheck->isChecked())
{
QString key;
int i = 0;
for (IPTCEnvelopePriv::FileFormatMap::Iterator it = d->fileFormatMap.begin();
it != d->fileFormatMap.end(); ++it)
{
if (i == d->formatCB->currentIndex()) key = it.key();
i++;
}
QString format = key.section('-', 0, 0);
QString version = key.section('-', -1);
meta.setIptcTagString("Iptc.Envelope.FileFormat", format);
meta.setIptcTagString("Iptc.Envelope.FileVersion", version);
}
else if (d->priorityCheck->isValid())
{
meta.removeIptcTag("Iptc.Envelope.FileFormat");
meta.removeIptcTag("Iptc.Envelope.FileVersion");
}
if (d->dateSentCheck->isChecked())
{
meta.setIptcTagString("Iptc.Envelope.DateSent",
d->dateSentSel->date().toString(Qt::ISODate));
}
else
{
meta.removeIptcTag("Iptc.Envelope.DateSent");
}
if (d->timeSentCheck->isChecked())
{
meta.setIptcTagString("Iptc.Envelope.TimeSent",
d->timeSentSel->time().toString(Qt::ISODate) +
d->zoneSentSel->getTimeZone());
}
else
{
//.........这里部分代码省略.........
示例6: 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");
//.........这里部分代码省略.........
示例7: readMetadata
void IPTCSubjects::readMetadata(QByteArray& iptcData)
{
KPMetadata meta;
meta.setIptc(iptcData);
setSubjectsList(meta.getIptcSubjects());
}