From f875ad5313b86275c3fd48884063aefb8849235d Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Thu, 2 Feb 2017 14:13:14 +0100 Subject: Added loading bar to status bar Hovered links now display in status bar --- src/widgets/urllineedit.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/widgets/urllineedit.cpp') diff --git a/src/widgets/urllineedit.cpp b/src/widgets/urllineedit.cpp index 5c1f5c4..6f07a4a 100644 --- a/src/widgets/urllineedit.cpp +++ b/src/widgets/urllineedit.cpp @@ -20,6 +20,7 @@ #include "urllineedit.h" #include +#include UrlLineEdit::UrlLineEdit(QWidget *parent) : QLineEdit(parent) @@ -54,6 +55,11 @@ void UrlLineEdit::focusInEvent(QFocusEvent *event) { clearTextFormat(); QLineEdit::focusInEvent(event); + + // select the contents when receiving focus + // http://stackoverflow.com/a/35725950/1054406 + // mousePressEvent triggers right after focusInEvent so text selected in focusInEvent unselects by mousePressEvent + QTimer::singleShot(0, this, SLOT(selectAll())); } void UrlLineEdit::focusOutEvent(QFocusEvent *event) -- cgit v1.2.1