Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Is their a Qt API which differentiates between Removable Drives and a SD Card?
Forum Updated to NodeBB v4.3 + New Features

Is their a Qt API which differentiates between Removable Drives and a SD Card?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stoned Jesus
    wrote on last edited by
    #1

    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 :)

    --
    Thanks & Regards,
    Stoned Jesus

    1 Reply Last reply
    0
    • raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      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).

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Stoned Jesus
        wrote on last edited by
        #3

        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]

        --
        Thanks & Regards,
        Stoned Jesus

        1 Reply Last reply
        0
        • raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          not i am aware of.
          Only as i already said: "QFileIconProvider::icon()":http://qt-project.org/doc/qt-4.8/qfileiconprovider.html#icon-2

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved