Permalink
Browse files

Prevent QWebView from calling QWidget::setCursor

  • Loading branch information...
1 parent 3cc0280 commit 80d5df9b32f4ff4e3891058d520818d3d86b8351 Benjamin C Meyer committed Mar 26, 2009
Showing with 33 additions and 29 deletions.
  1. +33 −29 llmozlib2/llembeddedbrowserwindow.cpp
@@ -353,7 +353,7 @@ bool LLEmbeddedBrowserWindow::userActionIsEnabled(LLMozLib::EUserAction action)
break;
case LLMozLib::UA_NAVIGATE_BACK:
result = d->mPage->history()->canGoBack();
- break;
+ break;
case LLMozLib::UA_NAVIGATE_FORWARD:
result = d->mPage->history()->canGoForward();
break;
@@ -635,37 +635,41 @@ bool LLWebView::event(QEvent *event)
QCursor cursor = static_cast<SetCursorEvent*>(event)->cursor();
if (currentShape != cursor.shape()) {
- currentShape = cursor.shape();
- LLMozLib::ECursor llcursor;
- switch(currentShape)
- {
- case Qt::ArrowCursor:
- llcursor = LLMozLib::C_ARROW;
- break;
- case Qt::PointingHandCursor:
- llcursor = LLMozLib::C_POINTINGHAND;
- break;
- case Qt::IBeamCursor:
- llcursor = LLMozLib::C_IBEAM;
- break;
- case Qt::SplitVCursor:
- llcursor = LLMozLib::C_SPLITV;
- break;
- case Qt::SplitHCursor:
- llcursor = LLMozLib::C_SPLITH;
- break;
- default:
- qWarning() << "Unhandled cursor shape:" << currentShape;
+ currentShape = cursor.shape();
+ LLMozLib::ECursor llcursor;
+ switch(currentShape)
+ {
+ case Qt::ArrowCursor:
+ llcursor = LLMozLib::C_ARROW;
+ break;
+ case Qt::PointingHandCursor:
+ llcursor = LLMozLib::C_POINTINGHAND;
+ break;
+ case Qt::IBeamCursor:
+ llcursor = LLMozLib::C_IBEAM;
+ break;
+ case Qt::SplitVCursor:
+ llcursor = LLMozLib::C_SPLITV;
+ break;
+ case Qt::SplitHCursor:
+ llcursor = LLMozLib::C_SPLITH;
+ break;
+ default:
+ qWarning() << "Unhandled cursor shape:" << currentShape;
+ }
+
+ LLEmbeddedBrowserWindowEvent llevent(
+ window->getWindowId(),
+ window->getCurrentUri(),
+ ((int)llcursor));
+ window->d->mEventEmitter.update(&LLEmbeddedBrowserWindowObserver::onCursorChanged, llevent);
}
-
- LLEmbeddedBrowserWindowEvent llevent(
- window->getWindowId(),
- window->getCurrentUri(),
- ((int)llcursor));
- window->d->mEventEmitter.update(&LLEmbeddedBrowserWindowObserver::onCursorChanged, llevent);
event->accept();
return true;
- }
+ }
+ if (event->type() == QEvent::CursorChange) {
+ event->accept();
+ return true;
}
return QWebView::event(event);
}

0 comments on commit 80d5df9

Please sign in to comment.