diff --git a/src/qtgui/rclmain_w.cpp b/src/qtgui/rclmain_w.cpp index 0678f3a6..4d1cb257 100644 --- a/src/qtgui/rclmain_w.cpp +++ b/src/qtgui/rclmain_w.cpp @@ -289,8 +289,6 @@ void RclMain::init() connect(m_filtBGRP, SIGNAL(buttonClicked(int)),this, SLOT(catgFilter(int))); connect(m_filtCMB, SIGNAL(activated(int)), this, SLOT(catgFilter(int))); - sSearch->queryText->installEventFilter(this); - restable = new ResTable(this); verticalLayout->insertWidget(2, restable); actionShowResultsAsTable->setChecked(prefs.showResultsAsTable); @@ -2338,19 +2336,10 @@ void RclMain::toggleFullScreen() showFullScreen(); } -bool RclMain::eventFilter(QObject *, QEvent *event) +void RclMain::showEvent(QShowEvent *ev) { - if (event->type() == QEvent::KeyPress) { - LOGDEB2(("RclMain::eventFilter: keypress\n")); - // We used to map shift-home to reslist "goto first page" - // here but we now use shift-pageUp because shift-home is - // useful to select all inside the search entry - } else if (event->type() == QEvent::Show) { - LOGDEB2(("RclMain::eventFilter: Show\n")); - // move the focus to the search entry on show - sSearch->queryText->setFocus(); - } - return false; + sSearch->queryText->setFocus(); + QMainWindow::showEvent(ev); } void RclMain::applyStyleSheet() diff --git a/src/qtgui/rclmain_w.h b/src/qtgui/rclmain_w.h index 6921d904..3c186c78 100644 --- a/src/qtgui/rclmain_w.h +++ b/src/qtgui/rclmain_w.h @@ -89,7 +89,6 @@ public: init(); } ~RclMain() {} - virtual bool eventFilter(QObject *target, QEvent *event); QString getQueryDescription(); /** This is only called from main() to set an URL to be displayed (using @@ -106,6 +105,9 @@ public: // Takes copies of the args instead of refs. Lazy and safe. void newDupsW(const Rcl::Doc doc, const std::vector dups); +protected: + virtual void showEvent(QShowEvent *); + public slots: virtual void fileExit(); virtual void idxStatus();