Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. How to get USB device name and its relative mount point?
QtWS25 Last Chance

How to get USB device name and its relative mount point?

Scheduled Pinned Locked Moved 3rd Party Software
usbdevice idwindowslinuxcross platform
7 Posts 3 Posters 5.3k 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.
  • J Offline
    J Offline
    jackysupremacy
    wrote on last edited by
    #1

    Hello every one, this is my first topic on this forum that looks very nice.

    i would like to know how can i get the list of usb devices connected (i mean /dev/sd**) and their relative mount points (/media/user/USB for example)
    I need to put them in a QComboBox;
    i heard about libusb but after hours i still can't figure out how to get theese informations and how to convert them into a QStringList

    My program must works on both windows and linux but on Windows i need only the drive letter.

    Thank you for your help!

    1 Reply Last reply
    0
    • H Offline
      H Offline
      Huulivoide
      wrote on last edited by
      #2

      In Linux you could just parse /proc/mounts.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jackysupremacy
        wrote on last edited by
        #3

        Yes but how can i get only the removable devices?

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

          Hi,

          Since you're on linux, did you took a look at KDE's Solid library ?

          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
          • J Offline
            J Offline
            jackysupremacy
            wrote on last edited by
            #5

            hi, thank you for your answer,

            I didn't know that library so i've read this: https://techbase.kde.org/Development/Tutorials/Solid/Device_Discovery and to be honest it seems to be exactly what i need.

            But i can't see how to use it:
            i've added
            LIBS += -lkdeui
            to use kde classes but how can i add solid?
            Thank you,

            1 Reply Last reply
            0
            • J Offline
              J Offline
              jackysupremacy
              wrote on last edited by
              #6

              i can't find any documentation on how to use this lib in my QT, project

              1 Reply Last reply
              0
              • H Offline
                H Offline
                Huulivoide
                wrote on last edited by
                #7

                http://api.kde.org/frameworks-api/frameworks5-apidocs/solid/html/index.html

                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