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. QT Desktop USB Device Pluged/Unpluged Detection Based On PID&VID
Forum Updated to NodeBB v4.3 + New Features

QT Desktop USB Device Pluged/Unpluged Detection Based On PID&VID

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 4 Posters 2.9k Views 3 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.
  • yldzmuhammedY Offline
    yldzmuhammedY Offline
    yldzmuhammed
    wrote on last edited by
    #1

    Hello everyone.

    I am new around. So if I do a mistake, please forgive me. First, a short brief about myself.

    I am +10 years of experience embedded system developer. So I know a couple of things about C programming language (Not cpp sadly). And I know a couple of things about C#. That means I also develop .Net desktop applications. So I have some habits from the .Net platform.

    Now, I have a question.

    Currently, I am developing a test application to learn more about the QT platform.
    This application will connect to a USB Device (most probably an HID device).
    My expectation from the application is that it can detect when a USB device is inserted/removed.
    I can do it on .Net easily. But I am not sure how to do this in QT.
    On .Net, some OS hook functions notify me about the device insertion or removal. Is there anything like that in QT or how can I do this on QT?

    BTW, I bought a course on Udemy which is well known Bryan Cairns's course. He has 3 of them with different levels. I bought all three. I hope I choose the correct course. Is there any alternative suggestion to help me to improve myself?

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

      Hi and welcome to devnet,

      AFAIK, not directly however, KDE has the Solid framework that you can use for that purpose.

      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
      • Kent-DorfmanK Offline
        Kent-DorfmanK Offline
        Kent-Dorfman
        wrote on last edited by
        #3

        USB control/enumeration is a platform dependent function so will be different between Unix/Linux, Mac, and Windoze. In Linux the kernel generates catchable events when USB devices are added/deleted.

        1 Reply Last reply
        0
        • yldzmuhammedY Offline
          yldzmuhammedY Offline
          yldzmuhammed
          wrote on last edited by
          #4

          I think, there has to be a way to do this. Windows has that feature too. I used it with C# .Net. I believe there is a way to do this with QT.
          Does libusb help me with this?

          piervalliP 1 Reply Last reply
          0
          • yldzmuhammedY yldzmuhammed

            I think, there has to be a way to do this. Windows has that feature too. I used it with C# .Net. I believe there is a way to do this with QT.
            Does libusb help me with this?

            piervalliP Offline
            piervalliP Offline
            piervalli
            wrote on last edited by
            #5

            @yldzmuhammed

            i used this library to print on usb printer.
            https://github.com/fpoussin/QtUsb

            Should be useful in your case. It detects the connection/disconnection of the device.

            1 Reply Last reply
            1
            • yldzmuhammedY Offline
              yldzmuhammedY Offline
              yldzmuhammed
              wrote on last edited by
              #6

              @piervalli
              I have looked your link and seems very nice. But there is a problem.
              I am using MinGWx64 but that library build around msvc. Is it possible to compile that library with mingw?

              piervalliP 1 Reply Last reply
              0
              • yldzmuhammedY yldzmuhammed

                @piervalli
                I have looked your link and seems very nice. But there is a problem.
                I am using MinGWx64 but that library build around msvc. Is it possible to compile that library with mingw?

                piervalliP Offline
                piervalliP Offline
                piervalli
                wrote on last edited by piervalli
                #7

                @yldzmuhammed you need to compile by source to use Mingw, I use the same compiler (8.1)

                1 Reply Last reply
                0
                • yldzmuhammedY Offline
                  yldzmuhammedY Offline
                  yldzmuhammed
                  wrote on last edited by
                  #8

                  @piervalli can you guide me how to do this? I am new at this. How can I do? Can you share some keywords?

                  piervalliP 1 Reply Last reply
                  0
                  • yldzmuhammedY yldzmuhammed

                    @piervalli can you guide me how to do this? I am new at this. How can I do? Can you share some keywords?

                    piervalliP Offline
                    piervalliP Offline
                    piervalli
                    wrote on last edited by
                    #9

                    @yldzmuhammed

                    Sorry for delay, I lost the post. I not am an export for C++, but I have fixed errors for Mingw, I pushed it on github, try to compile (8.1 5.15.2).
                    https://github.com/piervalli/QtUsb

                    1 Reply Last reply
                    0
                    • JoeCFDJ JoeCFD referenced this topic on

                    • Login

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