本文整理汇总了C++中KPMetadata::getXmpTagString方法的典型用法代码示例。如果您正苦于以下问题:C++ KPMetadata::getXmpTagString方法的具体用法?C++ KPMetadata::getXmpTagString怎么用?C++ KPMetadata::getXmpTagString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KPMetadata
的用法示例。
在下文中一共展示了KPMetadata::getXmpTagString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readMetadata
void XMPContent::readMetadata(QByteArray& xmpData)
{
blockSignals(true);
KPMetadata meta;
meta.setXmp(xmpData);
KPMetadata::AltLangMap map;
QString data;
d->headlineEdit->clear();
d->headlineCheck->setChecked(false);
data = meta.getXmpTagString("Xmp.photoshop.Headline", false);
if (!data.isNull())
{
d->headlineEdit->setText(data);
d->headlineCheck->setChecked(true);
}
d->headlineEdit->setEnabled(d->headlineCheck->isChecked());
d->captionEdit->setValid(false);
map = meta.getXmpTagStringListLangAlt("Xmp.dc.description", false);
if (!map.isEmpty())
d->captionEdit->setValues(map);
data = meta.getXmpTagString("Xmp.photoshop.CaptionWriter", false);
if (!data.isNull())
{
d->writerEdit->setText(data);
d->writerCheck->setChecked(true);
}
d->writerEdit->setEnabled(d->writerCheck->isChecked());
d->copyrightEdit->setValid(false);
map = meta.getXmpTagStringListLangAlt("Xmp.dc.rights", false);
if (!map.isEmpty())
d->copyrightEdit->setValues(map);
blockSignals(false);
}
示例2: readMetadata
void XMPOrigin::readMetadata(QByteArray& xmpData)
{
blockSignals(true);
KPMetadata meta;
meta.setXmp(xmpData);
QString data;
QStringList code, list;
QDateTime dateTime;
QString dateTimeStr;
dateTimeStr = meta.getXmpTagString("Xmp.photoshop.DateCreated", false);
if (dateTimeStr.isEmpty())
dateTimeStr = meta.getXmpTagString("Xmp.xmp.CreateDate", false);
else if (dateTimeStr.isEmpty())
dateTimeStr = meta.getXmpTagString("Xmp.xmp.ModifyDate", false);
else if (dateTimeStr.isEmpty())
dateTimeStr = meta.getXmpTagString("Xmp.exif.DateTimeCreated", false);
else if (dateTimeStr.isEmpty())
dateTimeStr = meta.getXmpTagString("Xmp.exif.DateTimeOriginal", false);
else if (dateTimeStr.isEmpty())
dateTimeStr = meta.getXmpTagString("Xmp.tiff.DateTime", false);
else if (dateTimeStr.isEmpty())
dateTimeStr = meta.getXmpTagString("Xmp.xmp.ModifyDate", false);
else if (dateTimeStr.isEmpty())
dateTimeStr = meta.getXmpTagString("Xmp.xmp.MetadataDate", false);
d->dateCreatedSel->setDateTime(QDateTime::currentDateTime());
d->dateCreatedCheck->setChecked(false);
if (!dateTimeStr.isEmpty())
{
dateTime = QDateTime::fromString(dateTimeStr, Qt::ISODate);
if (dateTime.isValid())
{
d->dateCreatedSel->setDateTime(dateTime);
d->dateCreatedCheck->setChecked(true);
}
}
d->dateCreatedSel->setEnabled(d->dateCreatedCheck->isChecked());
d->syncHOSTDateCheck->setEnabled(d->dateCreatedCheck->isChecked());
d->syncEXIFDateCheck->setEnabled(d->dateCreatedCheck->isChecked());
dateTimeStr = meta.getXmpTagString("Xmp.exif.DateTimeDigitized", false);
d->dateDigitalizedSel->setDateTime(QDateTime::currentDateTime());
d->dateDigitalizedCheck->setChecked(false);
if (!dateTimeStr.isEmpty())
{
dateTime = QDateTime::fromString(dateTimeStr, Qt::ISODate);
if (dateTime.isValid())
{
d->dateDigitalizedSel->setDateTime(dateTime);
d->dateDigitalizedCheck->setChecked(true);
}
}
d->dateDigitalizedSel->setEnabled(d->dateDigitalizedCheck->isChecked());
d->cityEdit->clear();
d->cityCheck->setChecked(false);
data = meta.getXmpTagString("Xmp.photoshop.City", false);
if (!data.isNull())
{
d->cityEdit->setText(data);
d->cityCheck->setChecked(true);
}
d->cityEdit->setEnabled(d->cityCheck->isChecked());
d->sublocationEdit->clear();
d->sublocationCheck->setChecked(false);
data = meta.getXmpTagString("Xmp.iptc.Location", false);
if (!data.isNull())
{
d->sublocationEdit->setText(data);
d->sublocationCheck->setChecked(true);
}
d->sublocationEdit->setEnabled(d->sublocationCheck->isChecked());
d->provinceEdit->clear();
d->provinceCheck->setChecked(false);
data = meta.getXmpTagString("Xmp.photoshop.State", false);
if (!data.isNull())
{
d->provinceEdit->setText(data);
d->provinceCheck->setChecked(true);
}
d->provinceEdit->setEnabled(d->provinceCheck->isChecked());
d->countryCB->setCurrentIndex(0);
d->countryCheck->setChecked(false);
data = meta.getXmpTagString("Xmp.iptc.CountryCode", false);
if (!data.isNull())
{
int item = -1;
for (int i = 0 ; i < d->countryCB->count() ; ++i)
if (d->countryCB->itemText(i).left(3) == data)
item = i;
if (item != -1)
{
d->countryCB->setCurrentIndex(item);
//.........这里部分代码省略.........
示例3: slotListPhotosDoneForUpload
void PicasawebWindow::slotListPhotosDoneForUpload(int errCode, const QString &errMsg,
const QList <PicasaWebPhoto>& photosList)
{
disconnect(m_talker, SIGNAL(signalListPhotosDone(int,QString,QList<PicasaWebPhoto>)),
this, SLOT(slotListPhotosDoneForUpload(int,QString,QList<PicasaWebPhoto>)));
if (errCode != 0)
{
KMessageBox::error(this, i18n("Picasaweb Call Failed: %1\n", errMsg));
return;
}
typedef QPair<KUrl,PicasaWebPhoto> Pair;
m_transferQueue.clear();
KUrl::List urlList = m_widget->m_imgList->imageUrls(true);
if (urlList.isEmpty())
return;
for (KUrl::List::ConstIterator it = urlList.constBegin(); it != urlList.constEnd(); ++it)
{
KPImageInfo info(*it);
PicasaWebPhoto temp;
temp.title = info.name();
// Picasa doesn't support image titles. Include it in descriptions if needed.
QStringList descriptions = QStringList() << info.title() << info.description();
descriptions.removeAll("");
temp.description = descriptions.join("\n\n");
// check for existing items
QString localId;
KPMetadata meta;
if (meta.load((*it).toLocalFile()))
{
localId = meta.getXmpTagString("Xmp.kipi.picasawebGPhotoId");
}
QList<PicasaWebPhoto>::const_iterator itPWP;
for (itPWP = photosList.begin(); itPWP != photosList.end(); ++itPWP)
{
if ((*itPWP).id == localId)
{
temp.id = localId;
temp.editUrl = (*itPWP).editUrl;
temp.thumbURL = (*itPWP).thumbURL;
break;
}
}
//Tags from the database
temp.gpsLat.setNum(info.latitude());
temp.gpsLon.setNum(info.longitude());
temp.tags = info.tagsPath();
m_transferQueue.append( Pair( (*it), temp) );
}
if (m_transferQueue.isEmpty())
return;
m_currentAlbumID = m_widget->m_albumsCoB->itemData(
m_widget->m_albumsCoB->currentIndex()).toString();
m_imagesTotal = m_transferQueue.count();
m_imagesCount = 0;
m_widget->progressBar()->setFormat(i18n("%v / %m"));
m_widget->progressBar()->setMaximum(m_imagesTotal);
m_widget->progressBar()->setValue(0);
m_widget->progressBar()->show();
m_widget->progressBar()->progressScheduled(i18n("Picasa Export"), true, true);
m_widget->progressBar()->progressThumbnailChanged(KIcon("kipi").pixmap(22, 22));
m_renamingOpt = 0;
uploadNextPhoto();
}