Permalink
Browse files

Capture mouseMoveEvent on the graphics scene ane make sure the event …

…always accepted and has a button so QGraphicsView will never set the mouse cursor. Also some minor improvement and variable initialization
  • Loading branch information...
1 parent 60f4302 commit 0897c5ebca643e2917287b2fe0715edddb1437f5 Benjamin C Meyer committed Mar 31, 2009
Showing with 13 additions and 3 deletions.
  1. +1 −1 llmozlib2/llembeddedbrowserwindow.cpp
  2. +12 −2 llmozlib2/llembeddedbrowserwindow_p.h
@@ -422,7 +422,7 @@ void LLEmbeddedBrowserWindow::mouseUp(int16_t x, int16_t y)
void LLEmbeddedBrowserWindow::mouseMove(int16_t x, int16_t y)
{
#ifdef LLEMBEDDEDBROWSER_DEBUG
- qDebug() << "LLEmbeddedBrowserWindow" << __FUNCTION__ << x << y;
+ qDebug() << "LLEmbeddedBrowserWindow" << __FUNCTION__ << x << y << d->mCurrentMouseDown;
#endif
if (x == 0 && y == 0)
{
@@ -104,6 +104,7 @@ class LLEmbeddedBrowserWindowEmitter
#include "llmozlib2.h"
#include "llembeddedbrowserwindow.h"
+#include <qgraphicssceneevent.h>
class LLGraphicsScene : public QGraphicsScene
{
@@ -113,6 +114,12 @@ class LLGraphicsScene : public QGraphicsScene
LLGraphicsScene();
LLEmbeddedBrowserWindow *window;
+ void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent) {
+ QGraphicsScene::mouseMoveEvent(mouseEvent);
+ mouseEvent->setAccepted(true);
+ mouseEvent->setButtons(Qt::LeftButton);
+ }
+
private slots:
void repaintRequestedSlot(const QList<QRectF> &);
friend class LLEmbeddedBrowserWindow;
@@ -133,13 +140,16 @@ class LLWebView : public QWebView
Qt::CursorShape currentShape;
};
-
class LLEmbeddedBrowserWindowPrivate
{
public:
LLEmbeddedBrowserWindowPrivate()
: mParent(0)
, mPage(new LLWebPage)
+ , mView(0)
+ , mGraphicsScene(0)
+ , mGraphicsView(0)
+ , mCurrentMouseDown(Qt::NoButton)
, mPercentComplete(0)
, mStatusText("")
, mCurrentUri("")
@@ -165,9 +175,9 @@ class LLEmbeddedBrowserWindowPrivate
}
LLEmbeddedBrowserWindowEmitter< LLEmbeddedBrowserWindowObserver > mEventEmitter;
+ QImage mImage;
LLEmbeddedBrowser *mParent;
LLWebPage *mPage;
- QImage mImage;
LLWebView *mView;
LLGraphicsScene *mGraphicsScene;

0 comments on commit 0897c5e

Please sign in to comment.