diff --git a/ui/annotationtools.cpp b/ui/annotationtools.cpp index f2db3550d..afc71764f 100644 --- a/ui/annotationtools.cpp +++ b/ui/annotationtools.cpp @@ -11,6 +11,7 @@ // qt / kde includes #include +#include #include #include @@ -76,6 +77,11 @@ AnnotatorEngine::~AnnotatorEngine() { } +QCursor AnnotatorEngine::cursor() const +{ + return Qt::CrossCursor; +} + SmoothPath::SmoothPath( const QLinkedList &points, const QPen &pen ) : points ( points ), pen ( pen ) { diff --git a/ui/annotationtools.h b/ui/annotationtools.h index fdcae1bb0..dc36dc7c0 100644 --- a/ui/annotationtools.h +++ b/ui/annotationtools.h @@ -53,6 +53,8 @@ class AnnotatorEngine static void decodeEvent( const QMouseEvent * mouseEvent, EventType * eventType, Button * button ); static void decodeEvent( const QTabletEvent * tabletEvent, EventType * eventType, Button * button ); + virtual QCursor cursor() const; + protected: PageViewItem * item() { return m_item; } diff --git a/ui/pageview.cpp b/ui/pageview.cpp index b1cb6e4f4..e131d1e65 100644 --- a/ui/pageview.cpp +++ b/ui/pageview.cpp @@ -3657,7 +3657,7 @@ void PageView::updateCursor( const QPoint &p ) if ( d->annotator && d->annotator->active() ) { if ( pageItem || d->annotator->annotating() ) - setCursor( Qt::CrossCursor ); + setCursor( d->annotator->cursor() ); else setCursor( Qt::ForbiddenCursor ); } diff --git a/ui/pageviewannotator.cpp b/ui/pageviewannotator.cpp index 5395b7be4..eeeb9250c 100644 --- a/ui/pageviewannotator.cpp +++ b/ui/pageviewannotator.cpp @@ -630,6 +630,11 @@ class TextSelectorEngine : public AnnotatorEngine return QList< Okular::Annotation* >() << ann; } + QCursor cursor() const + { + return Qt::IBeamCursor; + } + private: // data PageView * m_pageView; @@ -777,6 +782,11 @@ bool PageViewAnnotator::annotating() const return active() && m_lockedItem; } +QCursor PageViewAnnotator::cursor() const +{ + return m_engine->cursor(); +} + QRect PageViewAnnotator::performRouteMouseOrTabletEvent(const AnnotatorEngine::EventType & eventType, const AnnotatorEngine::Button & button, const QPointF & pos, PageViewItem * item ) { diff --git a/ui/pageviewannotator.h b/ui/pageviewannotator.h index 11aac3ad9..f70eff9aa 100644 --- a/ui/pageviewannotator.h +++ b/ui/pageviewannotator.h @@ -70,6 +70,11 @@ class PageViewAnnotator : public QObject bool active() const; // @return Are we currently annotating (using the selected tool)? bool annotating() const; + + // returns the preferred cursor for the current tool. call this only + // if active() == true + QCursor cursor() const; + QRect routeMouseEvent( QMouseEvent * event, PageViewItem * item ); QRect routeTabletEvent( QTabletEvent * event, PageViewItem * item, const QPoint & localOriginInGlobal ); QRect performRouteMouseOrTabletEvent( const AnnotatorEngine::EventType & eventType, const AnnotatorEngine::Button & button,