本文整理汇总了C++中DMetadata::getImageDateTime方法的典型用法代码示例。如果您正苦于以下问题:C++ DMetadata::getImageDateTime方法的具体用法?C++ DMetadata::getImageDateTime怎么用?C++ DMetadata::getImageDateTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DMetadata
的用法示例。
在下文中一共展示了DMetadata::getImageDateTime方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setMetadata
void ImagePropertiesGPSTab::setMetadata(const DMetadata& meta, const KUrl& url)
{
double lat, lng;
const bool haveCoordinates = meta.getGPSLatitudeNumber(&lat) && meta.getGPSLongitudeNumber(&lng);
if (haveCoordinates)
{
double alt;
const bool haveAlt = meta.getGPSAltitude(&alt);
KGeoMap::GeoCoordinates coordinates(lat, lng);
if (haveAlt)
{
coordinates.setAlt(alt);
}
GPSImageInfo gpsInfo;
gpsInfo.coordinates = coordinates;
gpsInfo.dateTime = meta.getImageDateTime();
gpsInfo.rating = meta.getImageRating();
gpsInfo.url = url;
setGPSInfoList(GPSImageInfo::List() << gpsInfo);
}
else
{
clearGPSInfo();
}
}
示例2: openUrls
void ShowFoto::openUrls(const QList<QUrl> &urls)
{
if (!urls.isEmpty())
{
ShowfotoItemInfoList infos;
ShowfotoItemInfo iteminfo;
DMetadata meta;
for (QList<QUrl>::const_iterator it = urls.constBegin(); it != urls.constEnd(); ++it)
{
QFileInfo fi((*it).toLocalFile());
iteminfo.name = fi.fileName();
iteminfo.mime = fi.suffix();
iteminfo.size = fi.size();
iteminfo.url = QUrl::fromLocalFile(fi.filePath());
iteminfo.folder = fi.path();
iteminfo.dtime = fi.created();
meta.load(fi.filePath());
iteminfo.ctime = meta.getImageDateTime();
iteminfo.width = meta.getImageDimensions().width();
iteminfo.height = meta.getImageDimensions().height();
iteminfo.photoInfo = meta.getPhotographInformation();
infos.append(iteminfo);
}
if (d->droppedUrls)
{
//replace the equal sign with "<<" to keep the previous pics in the list
d->infoList << infos;
}
else
{
d->infoList = infos;
d->model->clearShowfotoItemInfos();
emit signalInfoList(d->infoList);
slotOpenUrl(d->thumbBar->currentInfo());
}
}
}
示例3: bestRepresentativeIndexFromList
/**
* @brief This function finds the best representative marker from a group of markers. This is needed to display a thumbnail for a marker group.
* @param indices A list containing markers.
* @param sortKey Determines the sorting options and is actually of type GPSImageInfoSorter::SortOptions
* @return Returns the index of the marker.
*/
QPersistentModelIndex MapViewModelHelper::bestRepresentativeIndexFromList(const QList<QPersistentModelIndex>& list,
const int sortKey)
{
if (list.isEmpty())
{
return QPersistentModelIndex();
}
// first convert from QPersistentModelIndex to QModelIndex
QList<QModelIndex> indexList;
QModelIndex bestIndex;
for (int i=0; i < list.count(); ++i)
{
const QModelIndex newIndex(list.at(i));
indexList.append(newIndex);
}
switch (d->application)
{
case MapWidgetView::ApplicationDigikam:
{
// now get the ImageInfos and convert them to GPSImageInfos
const QList<ImageInfo> imageInfoList = d->model->imageInfos(indexList);
GPSImageInfo::List gpsImageInfoList;
foreach(const ImageInfo& imageInfo, imageInfoList)
{
GPSImageInfo gpsImageInfo;
if (ImagePropertiesSideBarDB::GPSImageInfofromImageInfo(imageInfo, &gpsImageInfo))
{
gpsImageInfoList << gpsImageInfo;
}
}
if (gpsImageInfoList.size()!=indexList.size())
{
// this is a problem, and unexpected
return indexList.first();
}
// now determine the best available index
bestIndex = indexList.first();
GPSImageInfo bestGPSImageInfo = gpsImageInfoList.first();
for (int i=1; i < gpsImageInfoList.count(); ++i)
{
const GPSImageInfo& currentInfo = gpsImageInfoList.at(i);
if (GPSImageInfoSorter::fitsBetter(bestGPSImageInfo, GeoIface::SelectedNone,
currentInfo, GeoIface::SelectedNone,
GeoIface::SelectedNone, GPSImageInfoSorter::SortOptions(sortKey)))
{
bestIndex = indexList.at(i);
bestGPSImageInfo = currentInfo;
}
}
break;
}
case MapWidgetView::ApplicationImportUI:
{
// now get the CamItemInfo and convert them to GPSImageInfos
const QList<CamItemInfo> imageInfoList = d->importModel->camItemInfos(indexList);
GPSImageInfo::List gpsImageInfoList;
foreach(const CamItemInfo& imageInfo, imageInfoList)
{
const DMetadata meta(imageInfo.url().toLocalFile());
double lat, lng;
const bool hasCoordinates = meta.getGPSLatitudeNumber(&lat) && meta.getGPSLongitudeNumber(&lng);
if (!hasCoordinates)
{
continue;
}
GeoIface::GeoCoordinates coordinates(lat, lng);
double alt;
const bool haveAlt = meta.getGPSAltitude(&alt);
if (haveAlt)
{
coordinates.setAlt(alt);
}
GPSImageInfo gpsImageInfo;
gpsImageInfo.coordinates = coordinates;
gpsImageInfo.dateTime = meta.getImageDateTime();
gpsImageInfo.rating = meta.getImageRating();
gpsImageInfo.url = imageInfo.url();
//.........这里部分代码省略.........
示例4: openFolder
void ShowFoto::openFolder(const QUrl& url)
{
if (!url.isValid() || !url.isLocalFile())
{
return;
}
// Parse image IO mime types registration to get files filter pattern.
QString filter;
QStringList mimeTypes = supportedImageMimeTypes(QIODevice::ReadOnly, filter);
QString patterns = filter.toLower();
patterns.append (QLatin1String(" "));
patterns.append (filter.toUpper());
qCDebug(DIGIKAM_SHOWFOTO_LOG) << "patterns=" << patterns;
// Get all image files from directory.
QDir dir(url.toLocalFile(), patterns);
dir.setFilter(QDir::Files);
if (!dir.exists())
{
return;
}
QFileInfoList fileinfolist = dir.entryInfoList();
if (fileinfolist.isEmpty())
{
//emit signalSorry();
return;
}
QFileInfoList::const_iterator fi;
ShowfotoItemInfoList infos;
ShowfotoItemInfo iteminfo;
DMetadata meta;
// And open all items in image editor.
for (fi = fileinfolist.constBegin(); fi != fileinfolist.constEnd(); ++fi)
{
iteminfo.name = (*fi).fileName();
iteminfo.mime = (*fi).suffix();
iteminfo.size = (*fi).size();
iteminfo.folder = (*fi).path();
iteminfo.url = QUrl::fromLocalFile((*fi).filePath());
iteminfo.dtime = (*fi).created();
meta.load((*fi).filePath());
iteminfo.ctime = meta.getImageDateTime();
iteminfo.width = meta.getImageDimensions().width();
iteminfo.height = meta.getImageDimensions().height();
iteminfo.photoInfo = meta.getPhotographInformation();
infos.append(iteminfo);
}
if (d->droppedUrls)
{
d->infoList << infos;
}
else
{
d->infoList = infos;
d->model->clearShowfotoItemInfos();
emit signalInfoList(d->infoList);
slotOpenUrl(d->thumbBar->currentInfo());
}
d->lastOpenedDirectory = QUrl::fromLocalFile(dir.absolutePath());
}