惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

博客园 - 蚂蚁跳楼

博文阅读密码验证 - 博客园 qt 的视频教程 sed 使用 qt dbus 的一入门文章 qt越来越好了 ubuntu - 中文 qt-creator astyle Peizhi 捷豹汽车的车载系统 博文阅读密码验证 - 博客园 转一个文章:在腾讯的第一堂产品课 QML的一些基础的区分 qml的一个文章----可以看出状态、动画的使用 博文阅读密码验证 - 博客园 凡是人性的,都是如下的 全国经纬度,具体到县 web-nodkit 入门 一个文章-转年收入50万美元的软件工程师做的是什么类型的工作 qml 封装技巧-利用数据来进行适配 一个基于qml的网络封装库
qml中打开本地html
蚂蚁跳楼 · 2015-07-27 · via 博客园 - 蚂蚁跳楼

main.cpp

QString tmploc = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation);
QDir tmpdir(tmploc + "/my_little_project");

QDirIterator it(":", QDirIterator::Subdirectories);
bool isHtml = false;
while (it.hasNext())
{
QString tmpfile;
tmpfile = it.next();
isHtml = tmpfile.contains("html",Qt::CaseInsensitive);
if (QFileInfo(tmpfile).isFile() && (isHtml) )
{
QFileInfo file = QFileInfo(tmpdir.absolutePath() + tmpfile.right(tmpfile.size()-1));
file.dir().mkpath("."); // create full path if necessary
QFile::remove(file.absoluteFilePath()); // remove previous file to make sure we have the latest version
QFile::copy(tmpfile, file.absoluteFilePath());
break;
}
}
ctxt->setContextProperty(QStringLiteral("baseUrl"), QFileInfo(tmpdir.absolutePath() + "/index1.html").absoluteFilePath());

web.qml中
//import QtQuick 2.0
import QtQuick 2.2
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.2 as QuickControls
import QtWebView 1.0

Item{
signal changeUrl(string msg)
property string webParams
property alias weburl: mywebview.url
WebView{
id:mywebview
width:parent.width
height: parent.height
// url: baseUrl
// url:"file:///storage/sdcard0/my_little_project/index1.html"
url:"file:///"+baseUrl //这里必须这么写,否则有问题
onUrlChanged: {
changeUrl(mywebview.url+"")
webParams = mywebview.url
console.log("~~~~~~~~~~url:"+baseUrl)
}
}

}