Slight modify of autofocus caret
Make mouseclick event point slightly down. Add commented tries of more reliable methods of caret focusing.
This commit is contained in:
parent
a6443231e5
commit
e603d9a2d0
@ -446,10 +446,16 @@ class WebView(QWebView):
|
||||
"""
|
||||
frame = self.page().currentFrame()
|
||||
halfWidth = frame.scrollBarGeometry(Qt.Horizontal).width() / 2
|
||||
point = QPoint(halfWidth,1)
|
||||
point = QPoint(halfWidth,10)
|
||||
event = QMouseEvent(QMouseEvent.MouseButtonPress, point, point,
|
||||
point, Qt.LeftButton, Qt.LeftButton, Qt.NoModifier)
|
||||
QApplication.sendEvent(self, event)
|
||||
#frame.setFocus()
|
||||
#frame.documentElement().setFocus()
|
||||
#frame.documentElement().firstChild().setFocus()
|
||||
#self.page().focusNextPrevChild(True)
|
||||
#self.page().setContentEditable(True)
|
||||
#self.triggerPageAction(QWebPage.MoveToNextChar)
|
||||
|
||||
self._caret_exist = True
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user