Results 1 to 3 of 3

Thread: Reading/Writing data from/to usb device

  1. #1
    Join Date
    Jan 2006
    Posts
    162
    Thanks
    9
    Qt products
    Qt3
    Platforms
    Windows

    Default Reading/Writing data from/to usb device

    Hi there !

    I need to detect when an usb key is plugged and I also need to access (read/write) data stored onto that key.

    In my opinion the main problem is to auto detect the usb device ... then I imagine it is easy to read/write data (as it is on a hard drive).

    Could someone tell me how to detect the usb key ?

    Thanks in advance.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Reading/Writing data from/to usb device

    Two ways.

    Proper one:
    You should plug into some platform dependent routines which notify for such events. Windows probably has some api for this, but it's out of scope of this forum, so you'd have to find experts on this topic.

    Workaround:
    Monitor the list of drives yourself and act when something is added to the list. Just remember it can be some other device (cdrom?), not only a usb drive.

  3. #3
    Join Date
    Jan 2006
    Location
    Athens - Greece
    Posts
    219
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Reading/Writing data from/to usb device

    Seems that you mainly concern on a Windows specific solution. You could take a look at:
    How to match between physical usb device and its drive letter? and The Mass Storage Page. Wysota's #2 is easier

Similar Threads

  1. Best way to display lots of data fast
    By New2QT in forum Newbie
    Replies: 4
    Last Post: 16th October 2008, 23:46
  2. Custom Model Advice Requested
    By mclark in forum Qt Programming
    Replies: 3
    Last Post: 18th September 2008, 17:26
  3. Is it possible to stream data from device with phonon ?
    By Elder Orb in forum Qt-based Software
    Replies: 0
    Last Post: 24th July 2008, 20:58
  4. speed of setdata - lots of items in treeview
    By Big Duck in forum Qt Programming
    Replies: 4
    Last Post: 6th July 2006, 13:53
  5. Replies: 3
    Last Post: 23rd June 2006, 18:46

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.