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.cpp32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/widgets/kristalltextbrowser.cpp b/src/widgets/kristalltextbrowser.cpp
index b92bf0f..8f5b86a 100644
--- a/src/widgets/kristalltextbrowser.cpp
+++ b/src/widgets/kristalltextbrowser.cpp
@@ -28,10 +28,32 @@ void KristallTextBrowser::mouseReleaseEvent(QMouseEvent *event)
}
}
+void KristallTextBrowser::on_anchorClicked(const QUrl &url)
+{
+ emit this->anchorClicked(url, this->signal_new_tab);
+}
+
+
void KristallTextBrowser::mouseMoveEvent(QMouseEvent *event)
{
QTextBrowser::mouseMoveEvent(event);
+ this->updateCursor();
+}
+
+void KristallTextBrowser::setDefaultCursor(const QCursor &cur)
+{
+ this->wanted_cursor = cur;
+ this->updateCursor();
+}
+
+void KristallTextBrowser::focusInEvent(QFocusEvent *event)
+{
+ QTextBrowser::focusInEvent(event);
+ this->updateCursor();
+}
+void KristallTextBrowser::updateCursor()
+{
// 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
@@ -43,13 +65,3 @@ void KristallTextBrowser::mouseMoveEvent(QMouseEvent *event)
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;
-}