┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/dolphinsearchbox.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dolphinsearchbox.cpp b/src/dolphinsearchbox.cpp
index cc305599f..d27b08014 100644
--- a/src/dolphinsearchbox.cpp
+++ b/src/dolphinsearchbox.cpp
@@ -26,6 +26,7 @@
#include <kiconloader.h>
#include <QEvent>
+#include <QKeyEvent>
#include <QHBoxLayout>
#include <QToolButton>
@@ -63,6 +64,10 @@ bool DolphinSearchBox::event(QEvent* event)
{
if (event->type() == QEvent::Polish) {
m_searchInput->setFont(KGlobalSettings::generalFont());
+ } else if (event->type() == QEvent::KeyPress) {
+ if (static_cast<QKeyEvent *>(event)->key() == Qt::Key_Escape) {
+ m_searchInput->clear();
+ }
}
return QWidget::event(event);
}