当前位置:网站首页>After the mobile phone is connected to the computer, how can QT's QDIR read the mobile phone file path
After the mobile phone is connected to the computer, how can QT's QDIR read the mobile phone file path
2022-04-23 03:09:00 【Intimes】
Everybody knows Qt Of QFileSystemModel Class can build the file resource model on the hard disk , So as to realize simple file management and folder management , So how to get the files in the mobile phone ? Do it here i Use a small test :
Don't talk much Go straight to the code :
QString filedir = QCoreApplication::applicationDirPath();
QString filename = QFileDialog::getOpenFileName(
this,
" Please select the to open video.m4s file ",
filedir,
"m4s (video.m4s)");
// If you cancel opening, you will return to
if(filename==QString(""))
return;
// Write file path
ui->lineEdit->setText(filename);
In the slot function, directly type the code as above , You can open the file dialog box , Search for files . Usually we find files on our own computer , such as :
Now , I use my beloved little mobile phone USB Connecting to a computer , Open file operation permission , Have a try , Hey, you can see the mobile phone files
This is it. Android The internal files of the mobile phone . good , Now , We continue to test our code , Switch the directory to the mobile directory , And find what you want to open B Station file , such as :
This file is usually in android/data/tv.danmuku.bili/download/xxxxxxx/c_xxxxxxx/xx/ below . Please pay attention to the path shown in the figure above . Open at this time , As a result, the file path will become like this :
have a look , Has it changed , I posted this path is :
C:/Users/Jo/AppData/Local/Microsoft/Windows/Temporary Internet Files/Content.IE5/NY2XOM6A/video[1].m4s
C:/Users/Jo/AppData/Local/Microsoft/Windows/Temporary Internet Files/Content.IE5/4I7OJ28R/audio[1].m4s
in other words , Mobile phone files are actually stored in temporary files . We use the resource manager to find this path , Note that this path is hidden , You need to uncheck the hidden system file in the setting to find . This path can also be opened by browser , Is similar to the FTP The server :
You'll find that , The documents inside are really messy , It's not a file on your phone , It's all temporary files . The mobile phone file you just found , It will also be in the temporary file .
So , Want to use QT Implement the file system model , It's still a long way to go !
For all that , It still realizes reading mobile phone files , That's progress .
版权声明
本文为[Intimes]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230308063651.html
边栏推荐
- Distributed system services
- C# 读写二进制文件
- 微软是如何解决 PC 端程序多开问题的——内部实现
- Tencent video VIP member, weekly card special price of 9 yuan! Tencent official direct charging, members take effect immediately!
- Blazor University (12) - component lifecycle
- Recommend reading | share the trader's book list and ask famous experts for trading advice. The trading is wonderful
- This new feature of C 11, I would like to call it the strongest!
- TP5 email (2020-05-27)
- c#可变参数params的介绍
- Openfeign details show
猜你喜欢
ASP. Net 6 middleware series - execution sequence
Notes sur le développement de la tarte aux framboises (XII): commencer à étudier la suite UNO - 220 de la tarte aux framboises de contrôle industriel advantech (i): Introduction et fonctionnement du s
[new version release] componentone added Net 6 and blazor platform control support
OLED多级菜单记录
Blazor University (11)组件 — 替换子组件的属性
Array and collection types passed by openfeign parameters
C#中切片语法糖的使用
Realize QQ login with PHP
[format] simple output (2)
樹莓派開發筆記(十二):入手研華ADVANTECH工控樹莓派UNO-220套件(一):介紹和運行系統
随机推荐
Maui initial experience: Cool
7-11 重排链表 (25 分)
Laravel new route file
[format] simple output (2)
Source generator actual combat
对.NET未来的一点感悟
Fight leetcode again (290. Word law)
再战leetcode (290.单词规律)
基于.NetCore开发博客项目 StarBlog - (1) 为什么需要自己写一个博客?
If the deep replication of objects is realized through C #?
Service avalanche effect
This new feature of C 11, I would like to call it the strongest!
宁德时代地位不保?
中后二叉建树
手机连接电脑后,QT的QDIR怎么读取手机文件路径
2022年度Top9的任务管理系统
Blazor University (12) - component lifecycle
建立与遍历二叉树
AOT和单文件发布对程序性能的影响
.Net Core 限流控制-AspNetCoreRateLimit