【发布时间】:2014-03-31 02:29:35
【问题描述】:
我有最新的Qt,我也在试用QtWebKit.experimental,所以,不使用它不是限制。我希望能够从我的WebView 中选择文本,或者甚至能够捕获这些事件,无论如何,像下面这样的标准WebView 不允许我从中选择文本,我尝试这样做,但没有选择发生,我应该怎么做才能选择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 文件之外的元素,例如,我正在从 WebView 到 loadHtml 加载 HTML 内容。
【问题讨论】:
-
我认为现在没有办法做到这一点,以前的版本通过设置 WebView::pressGrabTime 来允许它。希望您能找到解决方案或等待新版本。