diff options
Diffstat (limited to 'lib/addressbar/urllineedit.cpp')
-rw-r--r-- | lib/addressbar/urllineedit.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/addressbar/urllineedit.cpp b/lib/addressbar/urllineedit.cpp index 33bc9dc..29a14cd 100644 --- a/lib/addressbar/urllineedit.cpp +++ b/lib/addressbar/urllineedit.cpp @@ -24,7 +24,7 @@ UrlLineEdit::UrlLineEdit(QWidget *parent) m_listView->setVisible(false); connect(m_listView, &Completer::completionActivated, this, &UrlLineEdit::setText); - auto *addressbar = qobject_cast<AddressBar *>(parent); + addressbar = qobject_cast<AddressBar *>(parent); Q_CHECK_PTR(addressbar); auto *copyAction = new QAction(tr("Copy URL"), this); @@ -41,9 +41,8 @@ UrlLineEdit::UrlLineEdit(QWidget *parent) actions.append(pasteAction); auto *loadAction = new QAction(tr("Paste and load"), this); - connect(loadAction, &QAction::triggered, this, [this]() { - this->setText(qApp->clipboard()->text()); - emit returnPressed(); + connect(loadAction, &QAction::triggered, this, [=]() { + emit addressbar->load(QUrl::fromUserInput(qApp->clipboard()->text())); }); actions.append(loadAction); @@ -115,7 +114,7 @@ void UrlLineEdit::focusOutEvent(QFocusEvent *event) if(url.isValid()) setUrl(url); - emit focusView(); + emit addressbar->giveFocus(); QLineEdit::focusOutEvent(event); } |