diff --git a/src/gui/SearchWidget.cpp b/src/gui/SearchWidget.cpp index 5f247ee101..31287c089e 100644 --- a/src/gui/SearchWidget.cpp +++ b/src/gui/SearchWidget.cpp @@ -16,6 +16,7 @@ */ #include "SearchWidget.h" +#include "gui/MainWindow.h" #include "ui_SearchHelpWidget.h" #include "ui_SearchWidget.h" @@ -94,10 +95,12 @@ bool SearchWidget::eventFilter(QObject* obj, QEvent* event) emit escapePressed(); return true; } else if (keyEvent->matches(QKeySequence::Copy)) { - // If Control+C is pressed in the search edit when no text - // is selected, copy the password of the current entry. + // If the system Copy shortcut (typically Ctrl+C or Cmd+C) is pressed + // in the search edit when no text is selected, route the event to the + // main window. With the default shorcut configuration, this will copy + // the password of the current entry to the clipboard. if (!m_ui->searchEdit->hasSelectedText()) { - emit copyPressed(); + QCoreApplication::sendEvent(getMainWindow(), event); return true; } } else if (keyEvent->matches(QKeySequence::MoveToNextLine)) { @@ -135,7 +138,6 @@ void SearchWidget::connectSignals(SignalMultiplexer& mx) mx.connect(this, SIGNAL(saveSearch(QString)), SLOT(saveSearch(QString))); mx.connect(this, SIGNAL(caseSensitiveChanged(bool)), SLOT(setSearchCaseSensitive(bool))); mx.connect(this, SIGNAL(limitGroupChanged(bool)), SLOT(setSearchLimitGroup(bool))); - mx.connect(this, SIGNAL(copyPressed()), SLOT(copyPassword())); mx.connect(this, SIGNAL(downPressed()), SLOT(focusOnEntries())); mx.connect(SIGNAL(requestSearch(QString)), m_ui->searchEdit, SLOT(setText(QString))); mx.connect(SIGNAL(clearSearch()), this, SLOT(clearSearch())); diff --git a/src/gui/SearchWidget.h b/src/gui/SearchWidget.h index 55edad5833..8d2c63394d 100644 --- a/src/gui/SearchWidget.h +++ b/src/gui/SearchWidget.h @@ -57,7 +57,6 @@ class SearchWidget : public QWidget void caseSensitiveChanged(bool state); void limitGroupChanged(bool state); void escapePressed(); - void copyPressed(); void downPressed(); void enterPressed(); void lostFocus();