filtering search results More...
Public Slots | |
dbus export void | execute () |
Signals | |
void | prepareSearchResult (const QRegExp ®) |
Public Member Functions | |
ScreenedSearch (QWidget *parent=0) | |
dbus export int | getMinimumRange () |
dbus export void | setMinimumRange (int c) |
virtual | ~ScreenedSearch () |
filtering search results
// Binding example: SearchEngine::SearchEngine(MainWindow *parent) : QWidget(parent), mp_mainWindow(parent) { { ... ScreenedSearch* m_ScreenedSearch = new ScreenedSearch ( this ); // myLayout->addWidget(m_ScreenedSearch); ... connect ( m_ScreenedSearch, SIGNAL ( prepareSearchResult ( const QRegExp & ) ), this, SLOT ( visibleSearchResult ( const QRegExp & ) ) ); } void SearchEngine::visibleSearchResult ( const QRegExp ® ) { if (tabWidget->currentIndex() < 0) return; // FIXME QSortFilterProxyModel* model = all_tab.at(tabWidget->currentIndex())->getCurrentSearchListProxy(); model->setFilterRegExp( reg ); model->sort( NAME, Qt::AscendingOrder ); }
ScreenedSearch::ScreenedSearch | ( | QWidget * | parent = 0 ) |
Search Filter constructor
This file is part of the QBittorrent Project
Bittorrent Client using Qt4 and libtorrent. Copyright (C) 2006 Christophe Dumez
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
ScreenedSearch::~ScreenedSearch | ( | ) | [virtual] |
Search Filter destructor
void ScreenedSearch::prepareSearchResult | ( | const QRegExp & | reg ) | [signal] |
this signal is always emitted whenever the text from linedit has changed! if input length is >= minRange, it will send the given data otherwise it send's an empty string.
reg | filter regexp for current search result |
void ScreenedSearch::execute | ( | ) | [slot] |
send current value from linedit depends on searchTextChanged
int ScreenedSearch::getMinimumRange | ( | ) |
get current restricted text length
void ScreenedSearch::setMinimumRange | ( | int | c ) |
set minimum required text length before trigger prepareSearchResult
c | the default value is minimum 2 minRange |