]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinsearchbox.cpp
The feature freeze is near: Add video support to the Information Panel. Phonon is...
[dolphin.git] / src / dolphinsearchbox.cpp
index cc305599fbcbbb6e09ca8e651efd06896c10bfd4..d27b080148e1e3138e00f2e70823a87e9c7cb66b 100644 (file)
@@ -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);
 }