• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDE3Support

Public Slots | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
K3ListViewSearchLine Class Reference

#include <k3listviewsearchline.h>

Inheritance diagram for K3ListViewSearchLine:
Inheritance graph
[legend]

Public Slots

void addListView (K3ListView *lv)
 
void removeListView (K3ListView *lv)
 
void setCaseSensitive (bool cs)
 
void setKeepParentsVisible (bool v)
 
void setListView (K3ListView *lv)
 
void setListViews (const QList< K3ListView * > &lv)
 
void setSearchColumns (const QList< int > &columns)
 
virtual void updateSearch (const QString &s=QString())
 
- Public Slots inherited from KLineEdit
virtual void clear ()
 
bool passwordMode () const
 
void rotateText (KCompletionBase::KeyBindingType type)
 
void setCompletedItems (const QStringList &items, bool autoSuggest=true)
 
virtual void setCompletedText (const QString &)
 
void setPasswordMode (bool b=true)
 
virtual void setReadOnly (bool)
 
void setSqueezedText (const QString &text)
 
virtual void setText (const QString &)
 

Public Member Functions

 K3ListViewSearchLine (QWidget *parent=0, K3ListView *listView=0)
 
 K3ListViewSearchLine (QWidget *parent, const QList< K3ListView * > &listViews)
 
virtual ~K3ListViewSearchLine ()
 
bool caseSensitive () const
 
bool keepParentsVisible () const
 
K3ListView * listView () const
 
const QList< K3ListView * > & listViews () const
 
QList< int > searchColumns () const
 
- Public Member Functions inherited from KLineEdit
 KLineEdit (const QString &string, QWidget *parent=0)
 
 KLineEdit (QWidget *parent=0)
 
virtual ~KLineEdit ()
 
QSize clearButtonUsedSize () const
 
QString clickMessage () const
 
KCompletionBox * completionBox (bool create=true)
 
virtual void copy () const
 
void doCompletion (const QString &txt)
 
bool isClearButtonShown () const
 
bool isContextMenuEnabled () const
 
bool isSqueezedTextEnabled () const
 
QString originalText () const
 
void setClearButtonShown (bool show)
 
void setClickMessage (const QString &msg)
 
void setCompletionBox (KCompletionBox *box)
 
virtual void setCompletionMode (KGlobalSettings::Completion mode)
 
void setCompletionModeDisabled (KGlobalSettings::Completion mode, bool disable=true)
 
virtual void setCompletionObject (KCompletion *, bool hsig=true)
 
virtual void setContextMenuEnabled (bool showMenu)
 
void setSqueezedTextEnabled (bool enable)
 
void setTrapReturnKey (bool trap)
 
void setUrl (const KUrl &url)
 
void setUrlDropsEnabled (bool enable)
 
bool trapReturnKey () const
 
bool urlDropsEnabled () const
 
QString userText () const
 

Protected Slots

void activateSearch ()
 
void queueSearch (const QString &search)
 
- Protected Slots inherited from KLineEdit
virtual void makeCompletion (const QString &)
 
void userCancelled (const QString &cancelText)
 

Protected Member Functions

virtual bool canChooseColumnsCheck ()
 
virtual void connectListView (K3ListView *)
 
virtual void contextMenuEvent (QContextMenuEvent *e)
 
virtual void disconnectListView (K3ListView *)
 
virtual bool itemMatches (const Q3ListViewItem *item, const QString &s) const
 
virtual void updateSearch (K3ListView *listView)
 
- Protected Member Functions inherited from KLineEdit
bool autoSuggest () const
 
virtual void create (WId=0, bool initializeWindow=true, bool destroyOldWindow=true)
 
QMenu * createStandardContextMenu ()
 
virtual void dropEvent (QDropEvent *)
 
virtual bool event (QEvent *)
 
virtual void focusInEvent (QFocusEvent *ev)
 
virtual void focusOutEvent (QFocusEvent *ev)
 
virtual void keyPressEvent (QKeyEvent *)
 
virtual void mouseDoubleClickEvent (QMouseEvent *)
 
virtual void mousePressEvent (QMouseEvent *)
 
virtual void mouseReleaseEvent (QMouseEvent *)
 
virtual void paintEvent (QPaintEvent *ev)
 
virtual void resizeEvent (QResizeEvent *)
 
virtual void setCompletedText (const QString &, bool)
 
void setUserSelection (bool userSelection)
 

Additional Inherited Members

- Signals inherited from KLineEdit
void aboutToShowContextMenu (QMenu *menu)
 
void clearButtonClicked ()
 
void completion (const QString &)
 
void completionBoxActivated (const QString &)
 
void completionModeChanged (KGlobalSettings::Completion)
 
void returnPressed (const QString &)
 
void substringCompletion (const QString &)
 
void textRotation (KCompletionBase::KeyBindingType)
 
QT_MOC_COMPAT void userTextChanged (const QString &)
 
- Properties inherited from KLineEdit
QString clickMessage
 
bool contextMenuEnabled
 
bool passwordMode
 
bool showClearButton
 
bool squeezedTextEnabled
 
bool trapEnterKeyEvent
 
bool urlDropsEnabled
 

Detailed Description

This class makes it easy to add a search line for filtering the items in listviews based on a simple text search.

No changes to the application other than instantiating this class with appropriate K3ListViews should be needed.

Definition at line 38 of file k3listviewsearchline.h.

Constructor & Destructor Documentation

K3ListViewSearchLine::K3ListViewSearchLine ( QWidget *  parent = 0,
K3ListView *  listView = 0 
)

Constructs a K3ListViewSearchLine with listView being the K3ListView to be filtered.

If listView is null then the widget will be disabled until listviews are set with setListView(), setListViews() or added with addListView().

Definition at line 64 of file k3listviewsearchline.cpp.

K3ListViewSearchLine::K3ListViewSearchLine ( QWidget *  parent,
const QList< K3ListView * > &  listViews 
)

Constructs a K3ListViewSearchLine with listViews being the list of pointers to K3ListViews to be filtered.

If listViews is empty then the widget will be disabled until listviews are set with setListView(), setListViews() or added with addListView().

Definition at line 78 of file k3listviewsearchline.cpp.

K3ListViewSearchLine::~K3ListViewSearchLine ( )
virtual

Destroys the K3ListViewSearchLine.

Definition at line 92 of file k3listviewsearchline.cpp.

Member Function Documentation

void K3ListViewSearchLine::activateSearch ( )
protectedslot

When the timer started with queueSearch() expires this slot is called.

If there has been another timer started then this slot does nothing. However if there are no other pending searches this starts the list view search.

See also
queueSearch()

Definition at line 398 of file k3listviewsearchline.cpp.

void K3ListViewSearchLine::addListView ( K3ListView *  lv)
slot

Adds a K3ListView to the list of listviews filtered by this search line.

If lv is null then the widget will be disabled.

See also
listView(), setListViews(), removeListView()

Definition at line 133 of file k3listviewsearchline.cpp.

bool K3ListViewSearchLine::canChooseColumnsCheck ( )
protectedvirtual

Checks columns in all listviews and decides whether choosing columns to filter on makes any sense.

Returns false if either of the following is true:

  • there are no listviews connected,
  • the listviews have different numbers of columns,
  • the listviews have only one column,
  • the listviews differ in column labels.

Otherwise it returns true.

See also
setSearchColumns()

Definition at line 349 of file k3listviewsearchline.cpp.

bool K3ListViewSearchLine::caseSensitive ( ) const

Returns true if the search is case sensitive.

This defaults to false.

See also
setCaseSensitive()

Definition at line 97 of file k3listviewsearchline.cpp.

void K3ListViewSearchLine::connectListView ( K3ListView *  lv)
protectedvirtual

Connects signals of this listview to the appropriate slots of the search line.

Definition at line 333 of file k3listviewsearchline.cpp.

void K3ListViewSearchLine::contextMenuEvent ( QContextMenuEvent *  e)
protectedvirtual

Re-implemented for internal reasons.

API not affected.

Reimplemented from KLineEdit.

Definition at line 281 of file k3listviewsearchline.cpp.

void K3ListViewSearchLine::disconnectListView ( K3ListView *  lv)
protectedvirtual

Disconnects signals of a listviews from the search line.

Definition at line 341 of file k3listviewsearchline.cpp.

bool K3ListViewSearchLine::itemMatches ( const Q3ListViewItem *  item,
const QString &  s 
) const
protectedvirtual

Returns true if item matches the search s.

This will be evaluated based on the value of caseSensitive(). This can be overridden in subclasses to implement more complicated matching schemes.

Definition at line 252 of file k3listviewsearchline.cpp.

bool K3ListViewSearchLine::keepParentsVisible ( ) const

If this is true (the default) then the parents of matched items will also be shown.

See also
setKeepParentsVisible()

Definition at line 110 of file k3listviewsearchline.cpp.

K3ListView * K3ListViewSearchLine::listView ( ) const

Returns the listview that is currently filtered by the search.

If there are multiple listviews filtered, it returns 0.

See also
setListView(), listViews()

Definition at line 115 of file k3listviewsearchline.cpp.

const QList< K3ListView * > & K3ListViewSearchLine::listViews ( ) const

Returns the list of pointers to listviews that are currently filtered by the search.

See also
setListViews(), addListView(), listView()

Definition at line 123 of file k3listviewsearchline.cpp.

void K3ListViewSearchLine::queueSearch ( const QString &  search)
protectedslot

When keys are pressed a new search string is created and a timer is activated.

The most recent search is activated when this timer runs out if another key has not yet been pressed.

This method makes

Parameters
searchthe most recent search and starts the timer.

Together with activateSearch() this makes it such that searches are not started until there is a short break in the users typing.

See also
activateSearch()

Definition at line 391 of file k3listviewsearchline.cpp.

void K3ListViewSearchLine::removeListView ( K3ListView *  lv)
slot

Removes a K3ListView from the list of listviews filtered by this search line.

Does nothing if lv is 0 or is not filtered by the quick search line.

See also
listVew(), setListViews(), addListView()

Definition at line 145 of file k3listviewsearchline.cpp.

QList< int > K3ListViewSearchLine::searchColumns ( ) const

Returns the current list of columns that will be searched.

If the returned list is empty all visible columns will be searched.

See also
setSearchColumns

Definition at line 102 of file k3listviewsearchline.cpp.

void K3ListViewSearchLine::setCaseSensitive ( bool  cs)
slot

Make the search case sensitive or case insensitive.

See also
caseSenstive()

Definition at line 210 of file k3listviewsearchline.cpp.

void K3ListViewSearchLine::setKeepParentsVisible ( bool  v)
slot

When a search is active on a list that's organized into a tree view if a parent or ancesestor of an item is does not match the search then it will be hidden and as such so too will any children that match.

If this is set to true (the default) then the parents of matching items will be shown.

See also
keepParentsVisible

Definition at line 215 of file k3listviewsearchline.cpp.

void K3ListViewSearchLine::setListView ( K3ListView *  lv)
slot

Sets the K3ListView that is filtered by this search line, replacing any previously filtered listviews.

If lv is null then the widget will be disabled.

See also
listView(), setListViews()

Definition at line 226 of file k3listviewsearchline.cpp.

void K3ListViewSearchLine::setListViews ( const QList< K3ListView * > &  lv)
slot

Sets K3ListViews that are filtered by this search line, replacing any previously filtered listviews.

If lvs is empty then the widget will be disabled.

See also
listViews(), addListView(), setListView()

Definition at line 232 of file k3listviewsearchline.cpp.

void K3ListViewSearchLine::setSearchColumns ( const QList< int > &  columns)
slot

Sets the list of columns to be searched.

The default is to search all, visible columns which can be restored by passing columns as an empty list. If listviews to be filtered have different numbers or labels of columns this method has no effect.

See also
searchColumns

Definition at line 220 of file k3listviewsearchline.cpp.

void K3ListViewSearchLine::updateSearch ( const QString &  s = QString())
virtualslot

Updates search to only make visible the items that match s.

If s is null then the line edit's text will be used.

Definition at line 161 of file k3listviewsearchline.cpp.

void K3ListViewSearchLine::updateSearch ( K3ListView *  listView)
protectedvirtual

Updates search to only make visible appropriate items in listView.

If listView is null then nothing is done.

Definition at line 170 of file k3listviewsearchline.cpp.


The documentation for this class was generated from the following files:
  • k3listviewsearchline.h
  • k3listviewsearchline.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDE3Support

Skip menu "KDE3Support"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal