2012-10-08 32 views
3

過去5天,我嘗試了很多「解決方案」,試圖「打開」QML webview對象中的點擊,但我仍然無法點擊任何頁面上的任何鏈接。QML + Meego + webview失敗點擊任何網站上的任何東西

我在嵌入PayPal結帳頁面,可能它是非常簡單的東西,我錯過了。我嘗試了一個只有webview和沒有選項的空白頁面,除了width + height + javascripts(並且沒有js),我嘗試了下面的代碼(還有很多其他的東西),仍然沒有點擊。試圖詢問IRC並得到迴應:「即使使用最基本的webview設置,也應該始終可以點擊。」我在下面的代碼中將url從包含真實ap-key的URL更改爲dev開發者頁面,但問題是一樣的,無論它的google.com是paypal還是其他任何網站。

請問,任何人都知道我可以點擊任何東西?我無法點擊表單,也無法彈出一個鍵盤來填寫表單或任何點擊。

我在Meego平臺上運行QML + PySide。我從main.qml的Loader對象中加載下面的頁面/矩形。

任何幫助將不勝感激。

注意:我在qt-developer網絡上詢問過同樣的問題,但沒有得到答覆。嘗試在這裏,這個論壇是更加人口稠密,所以希望有這個問題的經驗的人會閱讀(我注意到,我不是唯一的這些問題,只是「應該工作」)。

import QtQuick 1.1 
import QtWebKit 1.1 
import com.nokia.meego 1.1 

Rectangle { 
Image { 
    id: background 
    source: "./images/bg.png" 
    anchors.fill: parent 
    Text { 
    id: logo 
    text: "My Fancy Logo" 
    x: 2 
    y: 2 
    font.pixelSize: 24 
    font.bold: true 
    font.italic: true 
    color: "white" 
    style: Text.Raised 
    styleColor: "black" 
    smooth: true 
    } 
    Rectangle { 
    id: rect 
    x: 0 
    y: 60 
    width: background.width 
    height: background.height - 70 
    Flickable { 
    id: flickable 
    width: parent.width 
    height: parent.height 
    contentWidth: Math.max(parent.width,webView.width) 
    contentHeight: Math.max(parent.height,webView.height) 
    flickableDirection: Flickable.HorizontalAndVerticalFlick 
    anchors.top: parent.top 
    anchors.bottom: parent.bottom 
    anchors.left: parent.left 
    anchors.right: parent.right 
    boundsBehavior: Flickable.DragOverBounds 
    clip:true 
    pressDelay: 200 

    WebView { 
    id: webView 
    settings.javascriptEnabled: true 
    settings.pluginsEnabled: true 
    url: "https://developer.paypal.com/" 
    anchors.top: parent.top 
    anchors.bottom: parent.bottom 
    anchors.left: parent.left 
    anchors.right: parent.right 
    transformOrigin: Item.Top 
    smooth: false 
    focus: true 

    preferredWidth: flickable.width 
    preferredHeight: flickable.height 
    PinchArea { 
    id: pinchArea 
    property real minScale: 1.0 
    anchors.fill: parent 
    property real lastScale: 1.0 
    pinch.target: webView 
    pinch.minimumScale: minScale 
    pinch.maximumScale: 3.0 

    onPinchFinished: { 
    flickable.returnToBounds(); 
    flickable.contentWidth = (flickable.width + flickable.width) * webView.scale; 
     flickable.contentHeight = (flickable.height + flickable.height) * webView.scale; 
     } 
    } 
    } 
    } 
    } 
} 
} 

回答

2

在您的QML標記的PinchArea元素是WebView中的一個孩子,因此之前的WebView獲取鼠標/觸摸按下事件。如果將元素分層結構中的PinchArea「移到」WebView「後面」,則鏈接將變爲可點擊的(除了登錄框下面的三個,因爲它們嘗試打開新的瀏覽器窗口)。

相關問題