首页 > Web开发 > 详细

QT renered html for js

时间:2014-03-08 19:47:59      阅读:578      评论:0      收藏:0      [点我收藏+]

voidMainWindow::on_pushButton_clicked()

{
QStringurl="http://www.baidu.com";
url="http://192.168.201.75/ttt";
ui->webView->setUrl(QUrl(url));
//ui->webView->load(QUrl(url));
}
voidMainWindow::on_webView_loadFinished(boolarg1)
{
QStringhtml=ui->webView->page()->mainFrame()->toHtml();
ui->plainTextEdit->setPlainText(html);
}

^C[root@wanglinan cbd]# vim zz.py

#!/usr/bin/env python
#encoding=utf-8
import bottle
from bottle import route, run, template,request,response,view,static_file
import os.path,sys,shutil,os
reload(sys)
os.chdir(os.path.dirname(__file__))
sys.setdefaultencoding(‘utf8‘)
path=os.path.join(os.getcwd(),"cbd")
print path
sys.path.append(path)
import codecs

@route("/ttt")
def ttt():
return """<html>
<title>aa</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$("#zz").html("<b>aaaaa</b>");
})
</script>
<body>
<div id="zz"></div>
</body>

</html>"""


if __name__ == "__main__":
session_opts = {
"session.type": "file",
‘session.cookie_expires‘: True,
‘session.auto‘: True,
‘session.data_dir‘: "cache",
}

app = bottle.default_app()
app.autojson = True
run(app = app,reloader = True,host=‘0.0.0.0‘,port = 80)


 

QT renered html for js,布布扣,bubuko.com

QT renered html for js

原文:http://www.cnblogs.com/lexus/p/3587764.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!