Public Slots | Signals | Public Member Functions

ScreenedSearch Class Reference

filtering search results More...

List of all members.

Public Slots

dbus export void execute ()

Signals

void prepareSearchResult (const QRegExp &reg)

Public Member Functions

 ScreenedSearch (QWidget *parent=0)
dbus export int getMinimumRange ()
dbus export void setMinimumRange (int c)
virtual ~ScreenedSearch ()

Detailed Description

filtering search results

Author:
Juergen Heinemann (Undfined) http://www.hjcms.de
Since:
2011/05/06
Version:
2.8.0
// 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 &reg )
{
  if (tabWidget->currentIndex() < 0)
      return; // FIXME

  QSortFilterProxyModel* model = all_tab.at(tabWidget->currentIndex())->getCurrentSearchListProxy();
  model->setFilterRegExp( reg );
  model->sort( NAME, Qt::AscendingOrder );
}

Constructor & Destructor Documentation

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


Member Function Documentation

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.

Parameters:
regfilter 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

Note:
it will also modify the current SpinBox value
See also:
setMinimumLength
Parameters:
cthe default value is minimum 2 minRange