Results 1 to 7 of 7

Thread: Is there any way to detect USB state?

  1. #1
    Join Date
    Dec 2009
    Posts
    18
    Thanks
    1

    Default Is there any way to detect USB state?

    Hi, there, FYI.

    Is there any way to dectect the USB state(insert/eject), I want to find such sample,
    and it's most probably running under win32/unix/macos.

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Is there any way to detect USB state?

    Qt does not offer any way to do that. You'll have to rely on other libraries to achieve what you want (e.g libusb).
    Current Qt projects : QCodeEdit, RotiDeCode

  3. #3
    Join Date
    Dec 2009
    Posts
    18
    Thanks
    1

    Default Re: Is there any way to detect USB state?

    Quote Originally Posted by fullmetalcoder View Post
    Qt does not offer any way to do that. You'll have to rely on other libraries to achieve what you want (e.g libusb).
    Thanks fullmetalcoder, but I found some Extended interface of QT,
    such as QUsbStorageGadget, QUsbManager etc. for Embeded Linux,
    Could we use these modules for our purpose?

  4. #4
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Is there any way to detect USB state?

    Where did you find those usb modules? Share the link, if you can.
    I'm a rebel in the S.D.G.

  5. #5
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Is there any way to detect USB state?

    QtExtended supports USB, but it's only for Embedded Linux, not Win32 or MacOS.

  6. #6
    Join Date
    Dec 2009
    Posts
    18
    Thanks
    1

    Default Re: Is there any way to detect USB state?

    Quote Originally Posted by lyuts View Post
    Where did you find those usb modules? Share the link, if you can.
    hi , lyuts, i found it in there:http://doc.trolltech.com/qtextended4...tprovider.html

    BR.

  7. #7
    Join Date
    Dec 2009
    Posts
    18
    Thanks
    1

    Default Re: Is there any way to detect USB state?

    I'm subclassing the WinHost, and to receive the WM_DEVICECHANGE message to detect the state of USB. but on my XP machine, i can not receive the message.

    for other platform, i want to use libusb.

    Is there any other good suggestion? Thansk.

Similar Threads

  1. How to design a state machine in face of non-blocking I/O?
    By piotr.dobrogost in forum Qt Programming
    Replies: 26
    Last Post: 14th August 2009, 19:48
  2. Qt State Machine Examples don't compile
    By vitalyx in forum Newbie
    Replies: 0
    Last Post: 4th April 2009, 14:19
  3. saving the state of the ui
    By zgulser in forum Qt Programming
    Replies: 3
    Last Post: 24th March 2009, 12:17
  4. fn+f1 keypress detect
    By oguzy in forum Qt Programming
    Replies: 1
    Last Post: 16th November 2008, 16:21
  5. Storing widget state
    By maverick_pol in forum Qt Programming
    Replies: 4
    Last Post: 10th April 2008, 09:55

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.