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. Get a List of Removable Devices [Win]
Forum Updated to NodeBB v4.3 + New Features

Get a List of Removable Devices [Win]

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.7k Views
  • 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.
  • K Offline
    K Offline
    Kai Mildner
    wrote on last edited by
    #1

    Hi,

    is it possible to get the information if a device, like an USB stick, is an removeable device? Actually i get a list of all drives by using

    QDir::drives()
    

    but is it possible to filter the result, to only display USB- stick or hardrives?

    Thanks for your help.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      Kai Mildner
      wrote on last edited by
      #3

      Could solve the Problem using WinAPI.

      Just include

      Windows.h
      

      and use the

      "UINT GetDriveTypeA(LPCSTR rootpath)" 
      

      funktion to get the drive Type.

      Reference on MSDN

      1 Reply Last reply
      2
      • VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by
        #2

        I don't think there is embedded in Qt but other specific libraries can do it easily.
        for example, libusb has libusb_get_device_list()

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        1 Reply Last reply
        2
        • K Offline
          K Offline
          Kai Mildner
          wrote on last edited by
          #3

          Could solve the Problem using WinAPI.

          Just include

          Windows.h
          

          and use the

          "UINT GetDriveTypeA(LPCSTR rootpath)" 
          

          funktion to get the drive Type.

          Reference on MSDN

          1 Reply Last reply
          2

          • Login

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