diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-02-02 14:13:14 +0100 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2017-02-02 14:13:14 +0100 |
commit | f875ad5313b86275c3fd48884063aefb8849235d (patch) | |
tree | 9c7933aacc895ab6a52045abc7fe8fb1dccb6c20 /src/widgets/urllineedit.cpp | |
parent | AStyle pass (diff) | |
download | smolbote-f875ad5313b86275c3fd48884063aefb8849235d.tar.xz |
Added loading bar to status bar
Hovered links now display in status bar
Diffstat (limited to 'src/widgets/urllineedit.cpp')
-rw-r--r-- | src/widgets/urllineedit.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
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 <QUrl> +#include <QTimer> 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) |