Bug 38614
| Summary: | QGraphicsWebView and QWebView does not call QInoutContext::mouseHandler() | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Manish <manish.s.sharma> |
| Component: | WebKit API | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED INVALID | ||
| Severity: | Critical | CC: | davidperez02.dp, manish.s.sharma |
| Priority: | P1 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | All | ||
| OS: | All | ||
Manish
QGraphicsWebView and QWebView widgets do not call QInputContext::mouseHandler. Below is the description for QInputContext::mouseHandler().
---------------------------------------------------------------------
void QInputContext::mouseHandler ( int x, QMouseEvent * event ) [virtual]
This function can be reimplemented in a subclass to handle mouse press, release, double-click, and move events within the preedit text. You can use the function to implement mouse-oriented user interface such as text selection or popup menu for candidate selection.
The x parameter is the offset within the string that was sent with the InputMethodCompose event. The alteration boundary of x is ensured as character boundary of preedit string accurately.
---------------------------------------------------------------------
QInputContext::mouseHandler should be called from QGraphicsWebView and QWebView similar to QLineEdit and QTextEdit because they are the one which gets the mousePress and mouseRelease events. Below is the reference code from QLineEdit.
void QLineEdit::mousePressEvent(QMouseEvent* e)
{
Q_D(QLineEdit);
if (d->sendMouseEventToInputContext(e))
return;
.
.
.
}
bool QLineEditPrivate::sendMouseEventToInputContext( QMouseEvent *e )
{
#if !defined QT_NO_IM
Q_Q(QLineEdit);
if ( control->composeMode() ) {
int tmp_cursor = xToPos(e->pos().x());
int mousePos = tmp_cursor - control->cursor();
if ( mousePos < 0 || mousePos > control->preeditAreaText().length() ) {
mousePos = -1;
// don't send move events outside the preedit area
if ( e->type() == QEvent::MouseMove )
return true;
}
QInputContext *qic = q->inputContext();
if ( qic )
// may be causing reset() in some input methods
qic->mouseHandler(mousePos, e);
if (!control->preeditAreaText().isEmpty())
return true;
}
#else
Q_UNUSED(e);
#endif
return false;
}
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
The Qt port has been removed from WebKit, resolving.