get rid of rclmain event filter

This commit is contained in:
Jean-Francois Dockes 2015-04-05 08:45:59 +02:00
parent db5089404a
commit 1b786815b7
2 changed files with 6 additions and 15 deletions

View file

@ -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()

View file

@ -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<Rcl::Doc> dups);
protected:
virtual void showEvent(QShowEvent *);
public slots:
virtual void fileExit();
virtual void idxStatus();