get rid of rclmain event filter

This commit is contained in:
Jean-Francois Dockes 2015-04-05 08:45:59 +02:00
parent 8289c66ec0
commit 817445cad0
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_filtBGRP, SIGNAL(buttonClicked(int)),this, SLOT(catgFilter(int)));
connect(m_filtCMB, SIGNAL(activated(int)), this, SLOT(catgFilter(int))); connect(m_filtCMB, SIGNAL(activated(int)), this, SLOT(catgFilter(int)));
sSearch->queryText->installEventFilter(this);
restable = new ResTable(this); restable = new ResTable(this);
verticalLayout->insertWidget(2, restable); verticalLayout->insertWidget(2, restable);
actionShowResultsAsTable->setChecked(prefs.showResultsAsTable); actionShowResultsAsTable->setChecked(prefs.showResultsAsTable);
@ -2338,19 +2336,10 @@ void RclMain::toggleFullScreen()
showFullScreen(); showFullScreen();
} }
bool RclMain::eventFilter(QObject *, QEvent *event) void RclMain::showEvent(QShowEvent *ev)
{ {
if (event->type() == QEvent::KeyPress) { sSearch->queryText->setFocus();
LOGDEB2(("RclMain::eventFilter: keypress\n")); QMainWindow::showEvent(ev);
// 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;
} }
void RclMain::applyStyleSheet() void RclMain::applyStyleSheet()

View File

@ -89,7 +89,6 @@ public:
init(); init();
} }
~RclMain() {} ~RclMain() {}
virtual bool eventFilter(QObject *target, QEvent *event);
QString getQueryDescription(); QString getQueryDescription();
/** This is only called from main() to set an URL to be displayed (using /** 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. // Takes copies of the args instead of refs. Lazy and safe.
void newDupsW(const Rcl::Doc doc, const std::vector<Rcl::Doc> dups); void newDupsW(const Rcl::Doc doc, const std::vector<Rcl::Doc> dups);
protected:
virtual void showEvent(QShowEvent *);
public slots: public slots:
virtual void fileExit(); virtual void fileExit();
virtual void idxStatus(); virtual void idxStatus();