我用用qwebview写了一个谷歌的电子地图导航,编译后在pc的linux上可以运行,但在开发板上无法运行,我用的是mini2410开发板,起初我还以为是内存不够跑不起来,结果我调试时返现,用qwebview->page()->mainFrame()->evaluateJavaScript("setXY(\"37\",\"48\")")传值的时候是可以的,但是用qwebview->page()->mainFrame()->evaluateJavaScript("setXY(37,48)")就不行,一传就死机,不知道为什么。望高手指点。
js脚本内容如下:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script src="http://maps.google.com/maps?file=api&v=2&key=mykey"
type="text/javascript"></script>
<script type="text/javascript">
var map;
function initialize()
{
if (GBrowserIsCompatible())
{
map = new GMap2(document.getElementById("map"));
map.setCenter( new GLatLng(0,0),1 );
}
}
function setXY(x,y)
{
map.setCenter( new GLatLng(x,y),13 );
}
</script>
</head>
<body>
<div id="map" style="width: 500px; height: 300px"></div>
</body>
</html>