From 992802bb5a3f00c563aa02244143d63a33ee1540 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sat, 19 Aug 2017 10:48:35 +0200 Subject: Added URL bar completer --- src/widgets/urllineedit.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/widgets/urllineedit.h') diff --git a/src/widgets/urllineedit.h b/src/widgets/urllineedit.h index 959461c..548000a 100644 --- a/src/widgets/urllineedit.h +++ b/src/widgets/urllineedit.h @@ -25,6 +25,8 @@ #include #include +#include + class UrlLineEdit : public QLineEdit { Q_OBJECT @@ -40,8 +42,10 @@ public slots: protected: void focusInEvent(QFocusEvent *event); void focusOutEvent(QFocusEvent *event); + void resizeEvent(QResizeEvent *event); private slots: + void showCompleter(const QString &text); void showMenu(); void copyUrl(); void pasteUrl(); @@ -56,6 +60,9 @@ private: QTextLayout::FormatRange m_hostFormat; QMenu *m_contextMenu; + + bool wasFocused = false; + QMenu *m_menu; }; #endif // URLLINEEDIT_H -- cgit v1.2.1