我有最新的Qt,另外,我正在嘗試QtWebKit.experimental
,所以,不要使用它並不是一個限制。我希望能夠從我的WebView
中選擇文本,或者甚至能夠捕獲這些事件,無論如何,像以下這樣的標準WebView
不允許我從中選擇文本,但我嘗試了,但沒有選擇發生,什麼我應該做一個可選的WebView
嗎?QML WebView不可選?
import QtQuick 2.2
import QtQuick.Window 2.1
import QtQuick.Controls 1.1
import QtWebKit 3.0
import QtWebKit.experimental 1.0
ApplicationWindow {
flags: Qt.FramelessWindowHint
width: 500
height: 500
x: (Screen.width - width)/2
y: (Screen.height - height)/2
color: "transparent"
WebView {
objectName: "html"
anchors.fill: parent
experimental.transparentBackground: true
focus: true
Keys.onEscapePressed: Qt.quit()
}
}
注意:我操縱QML文件外的元件,例如,我通過loadHtml
加載在WebView
HTML內容。
我認爲現在沒有辦法做到這一點,以前的版本允許通過設置WebView :: pressGrabTime。希望您能找到解決方案或等待新版本發佈。 – Redanium