aboutsummaryrefslogtreecommitdiff
path: root/src/widgets/kristalltextbrowser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kristalltextbrowser.cpp')
-rw-r--r--src/widgets/kristalltextbrowser.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/widgets/kristalltextbrowser.cpp b/src/widgets/kristalltextbrowser.cpp
index c813b05..f94485e 100644
--- a/src/widgets/kristalltextbrowser.cpp
+++ b/src/widgets/kristalltextbrowser.cpp
@@ -28,7 +28,27 @@ void KristallTextBrowser::mouseReleaseEvent(QMouseEvent *event)
}
}
+void KristallTextBrowser::mouseMoveEvent(QMouseEvent *event)
+{
+ QTextBrowser::mouseMoveEvent(event);
+
+ // This slight hack allows us to set the "default" cursor,
+ // (i.e when not hovering over links) We need to do this
+ // because QTextBrowser for some reason resets viewport cursor
+ // to ArrowCursor after we hover over links
+ const QCursor& cur = this->viewport()->cursor();
+ if (cur != this->wanted_cursor && cur != Qt::PointingHandCursor)
+ {
+ this->viewport()->setCursor(wanted_cursor);
+ }
+}
+
void KristallTextBrowser::on_anchorClicked(const QUrl &url)
{
emit this->anchorClicked(url, this->signal_new_tab);
}
+
+void KristallTextBrowser::setDefaultCursor(const QCursor &cur)
+{
+ this->wanted_cursor = cur;
+}