From 416339eac8ceceb00adcd9448f33df6157c0b88b Mon Sep 17 00:00:00 2001 From: Flavio Date: Fri, 5 Aug 2011 20:53:44 +0200 Subject: [PATCH] ESC clears search box --- src/searchlineedit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/searchlineedit.cpp b/src/searchlineedit.cpp index e63fbd9..65da3c5 100644 --- a/src/searchlineedit.cpp +++ b/src/searchlineedit.cpp @@ -56,6 +56,7 @@ ClearButton::ClearButton(QWidget *parent) setToolTip(tr("Clear")); setVisible(false); setFocusPolicy(Qt::NoFocus); + setShortcut(QKeySequence(Qt::Key_Escape)); } void ClearButton::paintEvent(QPaintEvent *event) @@ -65,7 +66,7 @@ void ClearButton::paintEvent(QPaintEvent *event) int height = this->height(); painter.setRenderHint(QPainter::Antialiasing, true); - QColor color = palette().color(QPalette::Mid); + // QColor color = palette().color(QPalette::Mid); painter.setBrush(isDown() ? palette().color(QPalette::Dark) : palette().color(QPalette::Mid)); -- 2.39.5