Important: Please read the Qt Code of Conduct -

QFileSystem or QDir to access Windows Phone which is plugged in via USB

  • Hello,

    I'm trying to get my pictures from Windows Phone automatically copied to my PC using a Qt Application running on my PC.

    I tried QFileSystem and QDir, however i can't acces it with QFileSystemModel nor QDir.
    In Windows Windows Phone is listed under "Devices and Drives" like my hdd.

    I can access files on Windows Phone via Windows Explorer.

    Any idea??

    // yes i googled....

  • Moderators

    When you access it from explorer does it have a drive letter assigned?

    If so then something like this should work:

    QDir phoneDir("f:/"); // assuming F: as phone drive letter
    if (phoneDir.exists())
    // do your stuff here

    Also you can use the following to get a list of drives which should then contain the drive letter of your phone:

    QFileInfoList fiList = QDir::drives();

    Finally if your phone does not have a drive letter then it isn't truly in the file system. It means that the driver it uses in windows is letting the OS access it directly but not giving it an easy "hard drive like" way for you to access it programatically. I can't help you with this one as I don't have a Windows phone or use windows. :)

Log in to reply