• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

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

#include <tdelistviewsearchline.h>

Inheritance diagram for TDEListViewSearchLine:
KLineEdit TDECompletionBase

Public Slots

virtual void updateSearch (const TQString &s=TQString::null)
 
void setCaseSensitive (bool cs)
 
void setKeepParentsVisible (bool v)
 
void setSearchColumns (const TQValueList< int > &columns)
 
void setListView (TDEListView *lv)
 
- Public Slots inherited from KLineEdit
virtual void setReadOnly (bool)
 
void rotateText (TDECompletionBase::KeyBindingType type)
 
virtual void setCompletedText (const TQString &)
 
void setCompletedItems (const TQStringList &items)
 
void setCompletedItems (const TQStringList &items, bool autoSuggest)
 
virtual void clear ()
 
void setSqueezedText (const TQString &text)
 
virtual void setText (const TQString &)
 

Public Member Functions

 TDEListViewSearchLine (TQWidget *parent=0, TDEListView *listView=0, const char *name=0)
 
 TDEListViewSearchLine (TQWidget *parent, const char *name)
 
virtual ~TDEListViewSearchLine ()
 
bool caseSensitive () const
 
TQValueList< int > searchColumns () const
 
bool keepParentsVisible () const
 
TDEListView * listView () const
 
- Public Member Functions inherited from KLineEdit
 KLineEdit (const TQString &string, TQWidget *parent, const char *name=0)
 
 KLineEdit (TQWidget *parent=0, const char *name=0)
 
virtual ~KLineEdit ()
 
void setURL (const KURL &url)
 
void cursorAtEnd ()
 
virtual void setCompletionMode (TDEGlobalSettings::Completion mode)
 
virtual void setContextMenuEnabled (bool showMenu)
 
bool isContextMenuEnabled () const
 
void setURLDropsEnabled (bool enable)
 
bool isURLDropsEnabled () const
 
void setTrapReturnKey (bool trap)
 
bool trapReturnKey () const
 
virtual bool eventFilter (TQObject *, TQEvent *)
 
TDECompletionBox * completionBox (bool create=true)
 
virtual void setCompletionObject (TDECompletion *, bool hsig=true)
 
virtual void copy () const
 
void setEnableSqueezedText (bool enable)
 
bool isSqueezedTextEnabled () const
 
TQString originalText () const
 
void setCompletionBox (TDECompletionBox *box)
 
void setClickMessage (const TQString &msg)
 
TQString clickMessage () const
 
- Public Member Functions inherited from TDECompletionBase
TDECompletion * completionObject (bool hsig=true)
 
virtual void setCompletionObject (TDECompletion *compObj, bool hsig=true)
 
virtual void setHandleSignals (bool handle)
 
bool isCompletionObjectAutoDeleted () const
 
void setAutoDeleteCompletionObject (bool autoDelete)
 
void setEnableSignals (bool enable)
 
bool handleSignals () const
 
bool emitSignals () const
 
virtual void setCompletionMode (TDEGlobalSettings::Completion mode)
 
TDEGlobalSettings::Completion completionMode () const
 
bool setKeyBinding (KeyBindingType item, const TDEShortcut &key)
 
const TDEShortcut & getKeyBinding (KeyBindingType item) const
 
void useGlobalKeyBindings ()
 
virtual void setCompletedText (const TQString &text)=0
 
virtual void setCompletedItems (const TQStringList &items)=0
 
TDECompletion * compObj () const
 

Protected Slots

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

Protected Member Functions

virtual bool itemMatches (const TQListViewItem *item, const TQString &s) const
 
virtual TQPopupMenu * createPopupMenu ()
 
- Protected Member Functions inherited from KLineEdit
virtual void resizeEvent (TQResizeEvent *)
 
virtual void keyPressEvent (TQKeyEvent *)
 
virtual void mousePressEvent (TQMouseEvent *)
 
virtual void mouseDoubleClickEvent (TQMouseEvent *)
 
virtual void mouseReleaseEvent (TQMouseEvent *)
 
virtual void contextMenuEvent (TQContextMenuEvent *)
 
virtual TQPopupMenu * createPopupMenu ()
 
virtual void drawContents (TQPainter *p)
 
virtual void dropEvent (TQDropEvent *)
 
virtual void setCompletedText (const TQString &, bool)
 
void setUserSelection (bool userSelection)
 
virtual void create (WId=0, bool initializeWindow=true, bool destroyOldWindow=true)
 
virtual void focusInEvent (TQFocusEvent *)
 
virtual void focusOutEvent (TQFocusEvent *)
 
bool autoSuggest () const
 
virtual void virtual_hook (int id, void *data)
 
- Protected Member Functions inherited from TDECompletionBase
KeyBindingMap getKeyBindings () const
 
void setDelegate (TDECompletionBase *delegate)
 
TDECompletionBase * delegate () const
 

Additional Inherited Members

- Public Types inherited from TDECompletionBase
enum  KeyBindingType
 
- Signals inherited from KLineEdit
void completionBoxActivated (const TQString &)
 
void returnPressed (const TQString &)
 
void completion (const TQString &)
 
void substringCompletion (const TQString &)
 
void textRotation (TDECompletionBase::KeyBindingType)
 
void completionModeChanged (TDEGlobalSettings::Completion)
 
void aboutToShowContextMenu (TQPopupMenu *p)
 
- Public Attributes inherited from TDECompletionBase
 TextCompletion
 
 PrevCompletionMatch
 
 NextCompletionMatch
 
 SubstringCompletion
 

Detailed Description

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

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

If you want the clear button and the search label, you should take a look at the TDEListViewSearchLineWidget

Note
{ When iterating over items in the TDEListView, make sure that the iterator only includes visible items (for example, by adding TQListViewItemIterator::Visible to the iterator flags). Otherwise, actions (such as deletion) may be taken on items that have been hidden by the search function. }
Since
3.3

Definition at line 47 of file tdelistviewsearchline.h.

Constructor & Destructor Documentation

◆ TDEListViewSearchLine() [1/2]

TDEListViewSearchLine::TDEListViewSearchLine ( TQWidget *  parent = 0,
TDEListView *  listView = 0,
const char *  name = 0 
)

Constructs a TDEListViewSearchLine with listView being the TDEListView to be filtered.

If listView is null then the widget will be disabled until a listview is set with setListView().

Definition at line 59 of file tdelistviewsearchline.cpp.

◆ TDEListViewSearchLine() [2/2]

TDEListViewSearchLine::TDEListViewSearchLine ( TQWidget *  parent,
const char *  name 
)

Constructs a TDEListViewSearchLine without any TDEListView to filter.

The TDEListView object has to be set later with setListView().

Definition at line 80 of file tdelistviewsearchline.cpp.

◆ ~TDEListViewSearchLine()

TDEListViewSearchLine::~TDEListViewSearchLine ( )
virtual

Destroys the TDEListViewSearchLine.

Definition at line 93 of file tdelistviewsearchline.cpp.

Member Function Documentation

◆ activateSearch

void TDEListViewSearchLine::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 291 of file tdelistviewsearchline.cpp.

◆ caseSensitive()

bool TDEListViewSearchLine::caseSensitive ( ) const

Returns true if the search is case sensitive.

This defaults to false.

See also
setCaseSensitive()

Definition at line 98 of file tdelistviewsearchline.cpp.

◆ createPopupMenu()

TQPopupMenu * TDEListViewSearchLine::createPopupMenu ( )
protectedvirtual

Re-implemented for internal reasons.

API not affected.

See TQLineEdit::mousePressEvent().

Reimplemented from KLineEdit.

Definition at line 234 of file tdelistviewsearchline.cpp.

◆ itemMatches()

bool TDEListViewSearchLine::itemMatches ( const TQListViewItem *  item,
const TQString &  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 205 of file tdelistviewsearchline.cpp.

◆ keepParentsVisible()

bool TDEListViewSearchLine::keepParentsVisible ( ) const

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

See also
setKeepParentsVisible()

Definition at line 108 of file tdelistviewsearchline.cpp.

◆ listView()

TDEListView * TDEListViewSearchLine::listView ( ) const

Returns the listview that is currently filtered by the search.

See also
setListView()

Definition at line 113 of file tdelistviewsearchline.cpp.

◆ queueSearch

void TDEListViewSearchLine::queueSearch ( const TQString &  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 284 of file tdelistviewsearchline.cpp.

◆ searchColumns()

TQValueList< int > TDEListViewSearchLine::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 103 of file tdelistviewsearchline.cpp.

◆ setCaseSensitive

void TDEListViewSearchLine::setCaseSensitive ( bool  cs)
slot

Make the search case sensitive or case insensitive.

See also
caseSenstive()

Definition at line 163 of file tdelistviewsearchline.cpp.

◆ setKeepParentsVisible

void TDEListViewSearchLine::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 168 of file tdelistviewsearchline.cpp.

◆ setListView

void TDEListViewSearchLine::setListView ( TDEListView *  lv)
slot

Sets the TDEListView that is filtered by this search line.

If lv is null then the widget will be disabled.

See also
listView()

Definition at line 178 of file tdelistviewsearchline.cpp.

◆ setSearchColumns

void TDEListViewSearchLine::setSearchColumns ( const TQValueList< 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.

See also
searchColumns

Definition at line 173 of file tdelistviewsearchline.cpp.

◆ updateSearch

void TDEListViewSearchLine::updateSearch ( const TQString &  s = TQString::null)
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 122 of file tdelistviewsearchline.cpp.


The documentation for this class was generated from the following files:
  • tdelistviewsearchline.h
  • tdelistviewsearchline.cpp

tdeui

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

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.4
This website is maintained by Timothy Pearson.