mirror of
https://github.com/martinrotter/rssguard.git
synced 2024-12-26 16:13:32 +01:00
show hovered links as tooltips
This commit is contained in:
parent
304fc1edfa
commit
f6dd3f88e7
@ -26,7 +26,7 @@
|
||||
<url type="donation">https://github.com/sponsors/martinrotter</url>
|
||||
<content_rating type="oars-1.1" />
|
||||
<releases>
|
||||
<release version="4.0.4" date="2021-10-29"/>
|
||||
<release version="4.0.4" date="2021-11-01"/>
|
||||
</releases>
|
||||
<content_rating type="oars-1.0">
|
||||
<content_attribute id="violence-cartoon">none</content_attribute>
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <QFileIconProvider>
|
||||
#include <QTimer>
|
||||
#include <QToolTip>
|
||||
|
||||
#if QT_VERSION_MAJOR == 6
|
||||
#include <QWebEngineContextMenuRequest>
|
||||
@ -32,6 +33,8 @@ WebViewer::WebViewer(QWidget* parent) : QWebEngineView(parent), m_root(nullptr)
|
||||
|
||||
setPage(page);
|
||||
resetWebPageZoom();
|
||||
|
||||
connect(page, &WebPage::linkHovered, this, &WebViewer::onLinkHovered);
|
||||
}
|
||||
|
||||
bool WebViewer::canIncreaseZoom() {
|
||||
@ -312,6 +315,12 @@ bool WebViewer::eventFilter(QObject* object, QEvent* event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void WebViewer::onLinkHovered(const QString& url) {
|
||||
qDebugNN << LOGSEC_GUI << "Hovered link:" << QUOTE_W_SPACE_DOT(url);
|
||||
|
||||
QToolTip::showText(QCursor::pos(), url, {}, {}, 6000);
|
||||
}
|
||||
|
||||
void WebViewer::openUrlWithExternalTool(ExternalTool tool, const QString& target_url) {
|
||||
tool.run(target_url);
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ class WebViewer : public QWebEngineView {
|
||||
virtual bool eventFilter(QObject* object, QEvent* event);
|
||||
|
||||
private slots:
|
||||
void onLinkHovered(const QString& url);
|
||||
void openUrlWithExternalTool(ExternalTool tool, const QString& target_url);
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user