Is their a Qt API which differentiates between Removable Drives and a SD Card?
-
I am working on a Qt application where I have a QTreewidget which displays the removable drives and local drives. I have set an icon each for local drives and a separate icon for removable drive.
I have 2 removable drives... One is a USB and other is a SDCard. Both are appearing as Removable drives in my treewidget with the same icon. I want to set 2 different icons. An SD icon for SD card and Removable drive icon for USB drive.
Is their a Qt API which can let me know whether the connected device is a USB drive(Removable Drive) or a SDCard(Using a sd card reader)?? Please help :)
-
you can try to get the "QtSystems":http://qt.gitorious.org/qt/qtsystems/blobs/dev/src/systeminfo/qstorageinfo.h module (Qt5 only). You have to build it manually though, because it is not officially deployed.
Alternatively you can get the OS's icon with "QFileIconProvider":http://qt-project.org/doc/qt-4.8/QFileIconProvider.html (passing it the drive path).
-
Thank you for the reply. I am using Qt 4.8. I tried QFSFileEngine but it gives me list of all drives. It doesnt help me to figure out whether the drive is a local or removable.
Is their any other APi which can help me out?
[quote author="raven-worx" date="1371469532"]you can try to get the "QtSystems":http://qt.gitorious.org/qt/qtsystems/blobs/dev/src/systeminfo/qstorageinfo.h module (Qt5 only). You have to build it manually though, because it is not officially deployed.
Alternatively you can get the OS's icon with "QFileIconProvider":http://qt-project.org/doc/qt-4.8/QFileIconProvider.html (passing it the drive path).[/quote]
-
not i am aware of.
Only as i already said: "QFileIconProvider::icon()":http://qt-project.org/doc/qt-4.8/qfileiconprovider.html#icon-2