题
我正在诺基亚QT中制作照片库应用程序,我想显示设备存储卡中的图片。如何从QT中的存储卡中获取图片?
解决方案
作为Eburger答案的附录,QTMobility的QSystoryStorageInfo可用于确定哪个(或)是否)是内存卡驱动器:
QSystemStorageInfo systemInfo;
QStringList driveList = systemInfo.logicalDrives();
QString memPath = "";
for (int index = 0; index < driveList.count(); index++)
{
if (QSystemStorageInfo::RemovableDrive == systemInfo.typeForDrive(driveList[index]))
{
memPath = driveList[index];
break; }
}
其他提示
QTMobility中的DocumentGallery应该完成工作: http://doc.qt.nokia.com/qtmobility-1.1.0/gallery.html. 。使用过滤器过滤文件,没有内存卡驱动器字母。
不隶属于 StackOverflow