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. Listing drives of a certain type (usb, network, fixed hard drives)
Forum Updated to NodeBB v4.3 + New Features

Listing drives of a certain type (usb, network, fixed hard drives)

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 1.5k 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.
  • Z Offline
    Z Offline
    Zarkon
    wrote on last edited by
    #1

    Hi,

    I have a (windows) program in which I like to list the USB drives that are attached. I like to keep it OS independent (if possible), but that is not a requirement

    @ aInfoList = aDir.drives();
    for (i = 0; i < aInfoList.count(); i++)
    {
    / * need something like
    if (aInfoList.at(i).drivetype == USB_DRIVE)
    */
    ui->comboBoxDrives->addItem(aInfoList.at(i).absoluteFilePath(), Qt::DisplayRole);
    }@

    Is this possible?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mcosta
      wrote on last edited by
      #2

      Hi,

      I think there's no way to do this in OS indepentent way.
      Probably you should use native API

      Once your problem is solved don't forget to:

      • Mark the thread as SOLVED using the Topic Tool menu
      • Vote up the answer(s) that helped you to solve the issue

      You can embed images using (http://imgur.com/) or (http://postimage.org/)

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        There's KDE's solid library that might help

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          Zarkon
          wrote on last edited by
          #4

          Did a bit of looking around. QSystemStorageInfo of Qt Mobility seems to have the functionality I need. I just need to figure out how to make it work on windows.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mcosta
            wrote on last edited by
            #5

            Hi,

            At the moment QtMobility is not parto of Qt standard package. I don't know if is still mantained

            Once your problem is solved don't forget to:

            • Mark the thread as SOLVED using the Topic Tool menu
            • Vote up the answer(s) that helped you to solve the issue

            You can embed images using (http://imgur.com/) or (http://postimage.org/)

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              AFAIK, some parts of QtMobility have been moved to Qt but not all

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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