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:
Artur Shaik 2015-04-13 19:55:45 +06:00
parent a6443231e5
commit e603d9a2d0

View File

@ -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: