From df1ff115f50f77473efeec33bea670388e7e3325 Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Fri, 6 Aug 2010 20:53:50 +0000 Subject: Theme Editor: Added coordinate display when moving mouse around preview window git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27738 a1c6a512-1295-4272-9138-f99709370657 --- utils/themeeditor/graphics/rbscreen.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'utils/themeeditor/graphics/rbscreen.cpp') diff --git a/utils/themeeditor/graphics/rbscreen.cpp b/utils/themeeditor/graphics/rbscreen.cpp index df72d50..1b1adc8 100644 --- a/utils/themeeditor/graphics/rbscreen.cpp +++ b/utils/themeeditor/graphics/rbscreen.cpp @@ -19,12 +19,15 @@ * ****************************************************************************/ +#include "rbscene.h" #include "rbscreen.h" #include "rbviewport.h" #include "devicestate.h" #include #include +#include +#include RBScreen::RBScreen(const RBRenderInfo& info, bool remote, QGraphicsItem *parent) @@ -32,6 +35,8 @@ RBScreen::RBScreen(const RBRenderInfo& info, bool remote, albumArt(0), customUI(0) { + setAcceptHoverEvents(true); + if(remote) { fullWidth = info.device()->data("remotewidth").toInt(); @@ -265,3 +270,13 @@ QColor RBScreen::stringToColor(QString str, QColor fallback) return retval; } + +void RBScreen::hoverMoveEvent(QGraphicsSceneHoverEvent *event) +{ + RBScene* s = dynamic_cast(scene()); + QPoint p = event->scenePos().toPoint(); + s->moveMouse("(" + QString::number(p.x()) + ", " + + QString::number(p.y()) + ")"); + + QGraphicsItem::hoverMoveEvent(event); +} -- cgit v1.1