\section{KIcon\-View\-Search\-Line Class Reference}
\label{classKIconViewSearchLine}\index{KIconViewSearchLine@{KIconViewSearchLine}}
This class makes it easy to add a search line for filtering the items in a iconview based on a simple text search.  


{\tt \#include $<$kiconviewsearchline.h$>$}

Inheritance diagram for KIcon\-View\-Search\-Line:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=105pt]{classKIconViewSearchLine__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KIcon\-View\-Search\-Line:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=105pt]{classKIconViewSearchLine__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
virtual void {\bf update\-Search} (const {\bf QString} \&s=QString::null)
\item 
void {\bf set\-Case\-Sensitive} (bool cs)
\item 
void {\bf set\-Icon\-View} ({\bf QIcon\-View} $\ast$iv)
\item 
void {\bf clear} ()
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KIcon\-View\-Search\-Line} ({\bf QWidget} $\ast$parent=0, {\bf QIcon\-View} $\ast$icon\-View=0, const char $\ast$name=0)
\item 
{\bf KIcon\-View\-Search\-Line} ({\bf QWidget} $\ast$parent, const char $\ast$name)
\item 
virtual {\bf $\sim$KIcon\-View\-Search\-Line} ()
\item 
bool {\bf case\-Sensitive} () const 
\item 
{\bf QIcon\-View} $\ast$ {\bf icon\-View} () const 
\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
void {\bf queue\-Search} (const {\bf QString} \&s)
\item 
void {\bf activate\-Search} ()
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual bool {\bf item\-Matches} (const {\bf QIcon\-View\-Item} $\ast$item, const {\bf QString} \&s) const 
\item 
void {\bf init} ({\bf QIcon\-View} $\ast$icon\-View=0)
\item 
void {\bf hide\-Item} ({\bf QIcon\-View\-Item} $\ast$item)
\item 
void {\bf show\-Item} ({\bf QIcon\-View\-Item} $\ast$item)
\end{CompactItemize}


\subsection{Detailed Description}
This class makes it easy to add a search line for filtering the items in a iconview based on a simple text search. 

No changes to the application other than instantiating this class with an appropriate {\bf QIcon\-View} should be needed.

\begin{Desc}
\item[Since:]3.3 \end{Desc}




Definition at line 38 of file kiconviewsearchline.h.

\subsection{Constructor \& Destructor Documentation}
\index{KIconViewSearchLine@{KIcon\-View\-Search\-Line}!KIconViewSearchLine@{KIconViewSearchLine}}
\index{KIconViewSearchLine@{KIconViewSearchLine}!KIconViewSearchLine@{KIcon\-View\-Search\-Line}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KIcon\-View\-Search\-Line::KIcon\-View\-Search\-Line ({\bf QWidget} $\ast$ {\em parent} = {\tt 0}, {\bf QIcon\-View} $\ast$ {\em icon\-View} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})}\label{classKIconViewSearchLine_a0}


Constructs a KIcon\-View\-Search\-Line with {\em icon\-View\/} being the {\bf QIcon\-View} to be filtered. 

If {\em icon\-View\/} is null then the widget will be disabled until a iconview is set with {\bf set\-Icon\-View()}{\rm (p.\,\pageref{classKIconViewSearchLine_i2})}. 

Definition at line 57 of file kiconviewsearchline.cpp.

References icon\-View(), and init().\index{KIconViewSearchLine@{KIcon\-View\-Search\-Line}!KIconViewSearchLine@{KIconViewSearchLine}}
\index{KIconViewSearchLine@{KIconViewSearchLine}!KIconViewSearchLine@{KIcon\-View\-Search\-Line}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KIcon\-View\-Search\-Line::KIcon\-View\-Search\-Line ({\bf QWidget} $\ast$ {\em parent}, const char $\ast$ {\em name})}\label{classKIconViewSearchLine_a1}


Constructs a KIcon\-View\-Search\-Line without any {\bf QIcon\-View} to filter. 

The {\bf QIcon\-View} object has to be set later with {\bf set\-Icon\-View()}{\rm (p.\,\pageref{classKIconViewSearchLine_i2})}. 

Definition at line 66 of file kiconviewsearchline.cpp.

References init().\index{KIconViewSearchLine@{KIcon\-View\-Search\-Line}!~KIconViewSearchLine@{$\sim$KIconViewSearchLine}}
\index{~KIconViewSearchLine@{$\sim$KIconViewSearchLine}!KIconViewSearchLine@{KIcon\-View\-Search\-Line}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KIcon\-View\-Search\-Line::$\sim${\bf KIcon\-View\-Search\-Line} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKIconViewSearchLine_a2}


Destroys the KIcon\-View\-Search\-Line. 



Definition at line 73 of file kiconviewsearchline.cpp.

References clear().

\subsection{Member Function Documentation}
\index{KIconViewSearchLine@{KIcon\-View\-Search\-Line}!caseSensitive@{caseSensitive}}
\index{caseSensitive@{caseSensitive}!KIconViewSearchLine@{KIcon\-View\-Search\-Line}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KIcon\-View\-Search\-Line::case\-Sensitive () const}\label{classKIconViewSearchLine_a3}


Returns true if the search is case sensitive. 

This defaults to false.

\begin{Desc}
\item[See also:]{\bf set\-Case\-Sensitive()}{\rm (p.\,\pageref{classKIconViewSearchLine_i1})} \end{Desc}


Definition at line 79 of file kiconviewsearchline.cpp.

Referenced by item\-Matches().\index{KIconViewSearchLine@{KIcon\-View\-Search\-Line}!iconView@{iconView}}
\index{iconView@{iconView}!KIconViewSearchLine@{KIcon\-View\-Search\-Line}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QIcon\-View} $\ast$ KIcon\-View\-Search\-Line::icon\-View () const}\label{classKIconViewSearchLine_a4}


Returns the iconview that is currently filtered by the search. 

\begin{Desc}
\item[See also:]{\bf set\-Icon\-View()}{\rm (p.\,\pageref{classKIconViewSearchLine_i2})} \end{Desc}


Definition at line 84 of file kiconviewsearchline.cpp.

Referenced by init(), and KIcon\-View\-Search\-Line().\index{KIconViewSearchLine@{KIcon\-View\-Search\-Line}!updateSearch@{updateSearch}}
\index{updateSearch@{updateSearch}!KIconViewSearchLine@{KIcon\-View\-Search\-Line}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-View\-Search\-Line::update\-Search (const {\bf QString} \& {\em s} = {\tt QString::null})\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKIconViewSearchLine_i0}


Updates search to only make visible the items that match {\em s\/}. 

If {\em s\/} is null then the line edit's text will be used. 

Definition at line 92 of file kiconviewsearchline.cpp.

References QValue\-List::begin(), QIcon\-View::current\-Item(), QValue\-List::end(), QIcon\-View::ensure\-Item\-Visible(), QIcon\-View::first\-Item(), hide\-Item(), item\-Matches(), QIcon\-View\-Item::next\-Item(), show\-Item(), QIcon\-View::sort(), and QLine\-Edit::text().

Referenced by activate\-Search().\index{KIconViewSearchLine@{KIcon\-View\-Search\-Line}!setCaseSensitive@{setCaseSensitive}}
\index{setCaseSensitive@{setCaseSensitive}!KIconViewSearchLine@{KIcon\-View\-Search\-Line}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-View\-Search\-Line::set\-Case\-Sensitive (bool {\em cs})\hspace{0.3cm}{\tt  [slot]}}\label{classKIconViewSearchLine_i1}


Make the search case sensitive or case insensitive. 

\begin{Desc}
\item[See also:]case\-Senstive() \end{Desc}


Definition at line 164 of file kiconviewsearchline.cpp.\index{KIconViewSearchLine@{KIcon\-View\-Search\-Line}!setIconView@{setIconView}}
\index{setIconView@{setIconView}!KIconViewSearchLine@{KIcon\-View\-Search\-Line}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-View\-Search\-Line::set\-Icon\-View ({\bf QIcon\-View} $\ast$ {\em iv})\hspace{0.3cm}{\tt  [slot]}}\label{classKIconViewSearchLine_i2}


Sets the {\bf QIcon\-View} that is filtered by this search line. 

If {\em lv\/} is null then the widget will be disabled.

\begin{Desc}
\item[See also:]{\bf icon\-View()}{\rm (p.\,\pageref{classKIconViewSearchLine_a4})} \end{Desc}


Definition at line 169 of file kiconviewsearchline.cpp.\index{KIconViewSearchLine@{KIcon\-View\-Search\-Line}!clear@{clear}}
\index{clear@{clear}!KIconViewSearchLine@{KIcon\-View\-Search\-Line}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-View\-Search\-Line::clear ()\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKIconViewSearchLine_i3}


Clear line edit and empty hidden\-Items, returning elements to icon\-View. 



Reimplemented from {\bf KLine\-Edit} {\rm (p.\,\pageref{classKLineEdit_i5})}.

Definition at line 137 of file kiconviewsearchline.cpp.

References KLine\-Edit::clear(), endl(), kd\-Debug(), and show\-Item().

Referenced by $\sim$KIcon\-View\-Search\-Line().\index{KIconViewSearchLine@{KIcon\-View\-Search\-Line}!itemMatches@{itemMatches}}
\index{itemMatches@{itemMatches}!KIconViewSearchLine@{KIcon\-View\-Search\-Line}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KIcon\-View\-Search\-Line::item\-Matches (const {\bf QIcon\-View\-Item} $\ast$ {\em item}, const {\bf QString} \& {\em s}) const\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKIconViewSearchLine_b0}


Returns true if {\em item\/} matches the search {\em s\/}. 

This will be evaluated based on the value of {\bf case\-Sensitive()}{\rm (p.\,\pageref{classKIconViewSearchLine_a3})}. This can be overridden in subclasses to implement more complicated matching schemes. 

Definition at line 190 of file kiconviewsearchline.cpp.

References case\-Sensitive().

Referenced by update\-Search().\index{KIconViewSearchLine@{KIcon\-View\-Search\-Line}!init@{init}}
\index{init@{init}!KIconViewSearchLine@{KIcon\-View\-Search\-Line}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-View\-Search\-Line::init ({\bf QIcon\-View} $\ast$ {\em icon\-View} = {\tt 0})\hspace{0.3cm}{\tt  [protected]}}\label{classKIconViewSearchLine_b1}


Do initialization common to both constructors. 



Definition at line 202 of file kiconviewsearchline.cpp.

References icon\-View(), queue\-Search(), and QLine\-Edit::text\-Changed().

Referenced by KIcon\-View\-Search\-Line().\index{KIconViewSearchLine@{KIcon\-View\-Search\-Line}!hideItem@{hideItem}}
\index{hideItem@{hideItem}!KIconViewSearchLine@{KIcon\-View\-Search\-Line}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-View\-Search\-Line::hide\-Item ({\bf QIcon\-View\-Item} $\ast$ {\em item})\hspace{0.3cm}{\tt  [protected]}}\label{classKIconViewSearchLine_b2}


Hide item. 



Definition at line 222 of file kiconviewsearchline.cpp.

References QIcon\-View::take\-Item().

Referenced by update\-Search().\index{KIconViewSearchLine@{KIcon\-View\-Search\-Line}!showItem@{showItem}}
\index{showItem@{showItem}!KIconViewSearchLine@{KIcon\-View\-Search\-Line}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-View\-Search\-Line::show\-Item ({\bf QIcon\-View\-Item} $\ast$ {\em item})\hspace{0.3cm}{\tt  [protected]}}\label{classKIconViewSearchLine_b3}


Show item. 

Just unhide it, doesn't necessary show it on screen, for that use icon\-View-$>$ensure\-Item\-Visible() 

Definition at line 231 of file kiconviewsearchline.cpp.

References endl(), and kd\-Debug().

Referenced by clear(), and update\-Search().\index{KIconViewSearchLine@{KIcon\-View\-Search\-Line}!queueSearch@{queueSearch}}
\index{queueSearch@{queueSearch}!KIconViewSearchLine@{KIcon\-View\-Search\-Line}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-View\-Search\-Line::queue\-Search (const {\bf QString} \& {\em s})\hspace{0.3cm}{\tt  [protected, slot]}}\label{classKIconViewSearchLine_j0}


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 \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s}]the most recent search and starts the timer.\end{description}
\end{Desc}
Together with {\bf activate\-Search()}{\rm (p.\,\pageref{classKIconViewSearchLine_j1})} this makes it such that searches are not started until there is a short break in the users typing.

\begin{Desc}
\item[See also:]{\bf activate\-Search()}{\rm (p.\,\pageref{classKIconViewSearchLine_j1})} \end{Desc}


Definition at line 247 of file kiconviewsearchline.cpp.

References activate\-Search(), and QTimer::single\-Shot().

Referenced by init().\index{KIconViewSearchLine@{KIcon\-View\-Search\-Line}!activateSearch@{activateSearch}}
\index{activateSearch@{activateSearch}!KIconViewSearchLine@{KIcon\-View\-Search\-Line}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KIcon\-View\-Search\-Line::activate\-Search ()\hspace{0.3cm}{\tt  [protected, slot]}}\label{classKIconViewSearchLine_j1}


When the timer started with {\bf queue\-Search()}{\rm (p.\,\pageref{classKIconViewSearchLine_j0})} 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 icon view search.

\begin{Desc}
\item[See also:]{\bf queue\-Search()}{\rm (p.\,\pageref{classKIconViewSearchLine_j0})} \end{Desc}


Definition at line 254 of file kiconviewsearchline.cpp.

References update\-Search().

Referenced by queue\-Search().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kiconviewsearchline.h\item 
kiconviewsearchline.cpp\end{CompactItemize}
