Changeset e1dcc00


Ignore:
Timestamp:
06/24/11 19:47:33 (10 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
8e5baaa
Parents:
41361d0
Message:

Enter or return triggers the search now when the focus is at the searchEdit or at one of the checkboxes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/searchhead.cpp

    r41361d0 re1dcc00  
    2020
    2121#include "searchhead.h"
     22#include <QShortcut>
    2223
    2324SearchHead::SearchHead(QWidget *parent)
     
    2526{
    2627        setupUi(this);
     28        QShortcut* shortcutEnter = new QShortcut(QKeySequence(Qt::Key_Enter), this, 0, 0, Qt::WidgetWithChildrenShortcut);
     29        connect(shortcutEnter, SIGNAL(activated()), this, SLOT(searchButtonClicked()));
     30        QShortcut* shortcutReturn = new QShortcut(QKeySequence(Qt::Key_Return), this, 0, 0, Qt::WidgetWithChildrenShortcut);
     31        connect(shortcutReturn, SIGNAL(activated()), this, SLOT(searchButtonClicked()));
    2732        connect( searchButton, SIGNAL(clicked()), SLOT(searchButtonClicked()));
    2833}
     
    3641void SearchHead::searchButtonClicked()
    3742{
    38     qDebug() << "SearchHead::searchButtonClicked()";
     43    // qDebug() << "SearchHead::searchButtonClicked()";
    3944    emit( searchClicked() );
    4045}
Note: See TracChangeset for help on using the changeset viewer.