\section{KCombo\-Box Class Reference}
\label{classKComboBox}\index{KComboBox@{KComboBox}}
A combined button, line-edit and a popup list widget. An enhanced combo box.  


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

Inheritance diagram for KCombo\-Box:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=171pt]{classKComboBox__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KCombo\-Box:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=175pt]{classKComboBox__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
void {\bf rotate\-Text} ({\bf KCompletion\-Base::Key\-Binding\-Type})
\begin{CompactList}\small\item\em Iterates through all possible matches of the completed text or the history list. \item\end{CompactList}\item 
virtual void {\bf set\-Completed\-Text} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Sets the completed text in the line-edit appropriately. \item\end{CompactList}\item 
void {\bf set\-Completed\-Items} (const  {\bf QString\-List} \&items)
\begin{CompactList}\small\item\em Sets {\tt items} into the completion-box if {\bf completion\-Mode}() is Completion\-Popup. \item\end{CompactList}\item 
void {\bf set\-Current\-Item} (const  {\bf QString} \&item, bool insert=false, int index=-1)
\begin{CompactList}\small\item\em Selects the first item that matches {\tt item}. \item\end{CompactList}\item 
void {\bf set\-Current\-Item} (int index)\label{classKComboBox_i4}

\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf return\-Pressed} ()
\begin{CompactList}\small\item\em Emitted when the user presses the Enter key. \item\end{CompactList}\item 
void {\bf return\-Pressed} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Emitted when the user presses the Enter key. \item\end{CompactList}\item 
void {\bf completion} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em This signal is emitted when the completion key is pressed. \item\end{CompactList}\item 
void {\bf substring\-Completion} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Emitted when the shortcut for substring completion is pressed. \item\end{CompactList}\item 
void {\bf text\-Rotation} ({\bf KCompletion\-Base::Key\-Binding\-Type})
\begin{CompactList}\small\item\em Emitted when the text rotation key-bindings are pressed. \item\end{CompactList}\item 
void {\bf completion\-Mode\-Changed} ({\bf KGlobal\-Settings::Completion})
\begin{CompactList}\small\item\em Emitted when the user changed the completion mode by using the popupmenu. \item\end{CompactList}\item 
void {\bf about\-To\-Show\-Context\-Menu} ({\bf QPopup\-Menu} $\ast$)
\begin{CompactList}\small\item\em Emitted before the context menu is displayed. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KCombo\-Box} ({\bf QWidget} $\ast$parent=0, const  char $\ast$name=0)
\begin{CompactList}\small\item\em Constructs a read-only or rather select-only combo box with a parent object and a name. \item\end{CompactList}\item 
{\bf KCombo\-Box} (bool rw, {\bf QWidget} $\ast$parent=0, const  char $\ast$name=0)
\begin{CompactList}\small\item\em Constructs a \char`\"{}read-write\char`\"{} or \char`\"{}read-only\char`\"{} combo box depending on the value of the first argument( {\tt rw} ) with a parent, a name. \item\end{CompactList}\item 
virtual {\bf $\sim$KCombo\-Box} ()
\begin{CompactList}\small\item\em Destructor. \item\end{CompactList}\item 
void {\bf set\-Edit\-URL} (const  {\bf KURL} \&url)
\begin{CompactList}\small\item\em Sets {\tt url} into the edit field of the combobox. \item\end{CompactList}\item 
void {\bf insert\-URL} (const  {\bf KURL} \&url, int index=-1)
\begin{CompactList}\small\item\em Inserts {\tt url} at position {\tt index} into the combobox. \item\end{CompactList}\item 
void {\bf insert\-URL} (const  {\bf QPixmap} \&{\bf pixmap}, const  {\bf KURL} \&url, int index=-1)
\begin{CompactList}\small\item\em Inserts {\tt url} with the pixmap \&p pixmap at position {\tt index} into the combobox. \item\end{CompactList}\item 
void {\bf change\-URL} (const  {\bf KURL} \&url, int index)
\begin{CompactList}\small\item\em Replaces the item at position {\tt index} with {\tt url}. \item\end{CompactList}\item 
void {\bf change\-URL} (const  {\bf QPixmap} \&{\bf pixmap}, const  {\bf KURL} \&url, int index)
\begin{CompactList}\small\item\em Replaces the item at position {\tt index} with {\tt url} and pixmap {\tt pixmap}. \item\end{CompactList}\item 
int {\bf cursor\-Position} () const 
\begin{CompactList}\small\item\em Returns the current cursor position. \item\end{CompactList}\item 
virtual void {\bf set\-Auto\-Completion} (bool autocomplete)
\begin{CompactList}\small\item\em Re-implemented from {\bf QCombo\-Box}. \item\end{CompactList}\item 
bool {\bf auto\-Completion} () const 
\begin{CompactList}\small\item\em Re-implemented from {\bf QCombo\-Box}. \item\end{CompactList}\item 
virtual void {\bf set\-Context\-Menu\-Enabled} (bool show\-Menu)
\begin{CompactList}\small\item\em Enables or disable the popup (context) menu. \item\end{CompactList}\item 
bool {\bf is\-Context\-Menu\-Enabled} () const 
\begin{CompactList}\small\item\em Returns {\tt true} when the context menu is enabled. \item\end{CompactList}\item 
void {\bf set\-URLDrops\-Enabled} (bool enable)
\begin{CompactList}\small\item\em Enables/Disables handling of URL drops. \item\end{CompactList}\item 
bool {\bf is\-URLDrops\-Enabled} () const 
\begin{CompactList}\small\item\em Returns {\tt true} when decoded URL drops are enabled. \item\end{CompactList}\item 
bool {\bf contains} (const  {\bf QString} \&{\bf text}) const 
\begin{CompactList}\small\item\em Convenience method which iterates over all items and checks if any of them is equal to {\tt text}. \item\end{CompactList}\item 
void {\bf set\-Trap\-Return\-Key} (bool trap)
\begin{CompactList}\small\item\em By default, KCombo\-Box recognizes Key\_\-Return and Key\_\-Enter and emits the {\bf return\-Pressed}{\rm (p.\,\pageref{classKComboBox_l0})}() signals, but it also lets the event pass, for example causing a dialog's default-button to be called. \item\end{CompactList}\item 
bool {\bf trap\-Return\-Key} () const 
\item 
virtual bool {\bf event\-Filter} ({\bf QObject} $\ast$, {\bf QEvent} $\ast$)
\begin{CompactList}\small\item\em Re-implemented for internal reasons. \item\end{CompactList}\item 
{\bf KCompletion\-Box} $\ast$ {\bf completion\-Box} (bool create=true)
\item 
virtual void {\bf set\-Line\-Edit} ({\bf QLine\-Edit} $\ast$)\label{classKComboBox_a20}

\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
virtual void {\bf item\-Selected} ({\bf QList\-Box\-Item} $\ast$)
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.}. \item\end{CompactList}\item 
virtual void {\bf make\-Completion} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Completes text according to the completion mode. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf set\-Completed\-Text} (const  {\bf QString} \&, bool)\label{classKComboBox_b0}

\item 
virtual void {\bf create} (WId=0, bool initialize\-Window=true, bool destroy\-Old\-Window=true)
\begin{CompactList}\small\item\em Reimplemented for internal reasons, the API is not affected. \item\end{CompactList}\item 
virtual void {\bf wheel\-Event} ({\bf QWheel\-Event} $\ast$ev)\label{classKComboBox_b2}

\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKComboBox_b3}

\end{CompactItemize}


\subsection{Detailed Description}
A combined button, line-edit and a popup list widget. An enhanced combo box. 

{\bf  Detail}

{\bf  This widget inherits from {\bf QCombo\-Box} and implements the following additional functionalities: a completion object that provides both automatic and manual text completion as well as text rotation features, configurable key-bindings to activate these features, and a popup-menu item that can be used to allow the user to change the text completion mode on the fly.}

{\bf  To support these new features KCombo\-Box emits a few additional signals such as {\bf completion}{\rm (p.\,\pageref{classKComboBox_l2})}( const {\bf QString}\& ) and {\bf text\-Rotation}{\rm (p.\,\pageref{classKComboBox_l4})}( Key\-Bindging\-Type ). The completion signal can be connected to a slot that will assist the user in filling out the remaining text while the rotation signal can be used to traverse through all possible matches whenever text completion results in multiple matches. Additionally, a {\bf return\-Pressed}{\rm (p.\,\pageref{classKComboBox_l0})}() and a {\bf return\-Pressed}{\rm (p.\,\pageref{classKComboBox_l0})}( const {\bf QString}\& ) signals are emitted when the user presses the Enter/Return key.}

{\bf  KCombobox by default creates a completion object when you invoke the {\bf completion\-Object}( bool ) member function for the first time or explicitly use {\bf set\-Completion\-Object}( KCompletion$\ast$, bool ) to assign your own completion object. Additionally, to make this widget more functional, KCombo\-Box will by default handle text rotation and completion events internally whenever a completion object is created through either one of the methods mentioned above. If you do not need this functionality, simply use {\bf KCompletion\-Base::set\-Handle\-Signals}(bool) or alternatively set the boolean parameter in the {\tt set\-Completion\-Object} call to FALSE.}

{\bf  The default key-bindings for completion and rotation is determined from the global settings in {\bf KStd\-Accel}. These values, however, can be overriden locally by invoking {\bf KCompletion\-Base::set\-Key\-Binding}(). The values can easily be reverted back to the default setting, by simply calling use\-Global\-Settings(). An alternate method would be to default individual key-bindings by usning {\bf set\-Key\-Binding}() with the default second argument.}

{\bf  In non-editable (select-only) mode only one completion mode, {\tt Completion\-Auto}, is available. All the other modes are simply ignored. Moreover, the Completion\-Auto mode, unlike in the read-write mode, works by matching any typed key with the first letter of entries in the combobox.}

{\bf  }

{\bf {\bf  Usage}}

{\bf {\bf  To enable the basic completion feature:}}

{\bf {\bf  \small\begin{alltt}
 KComboBox *combo = new KComboBox( true, this, "mywidget" );
 {\bf KCompletion} *comp = combo-$>${\bf completionObject()};
 // Connect to the return pressed signal - optional
 connect(combo,SIGNAL({\bf returnPressed(const QString&)}{\rm (p.\,\pageref{classKComboBox_l1})}),comp,SLOT(addItem(const QString&));\end{alltt}\normalsize 
}}

{\bf {\bf \small\begin{alltt} // Provide the to be completed strings. Note that those are separate from the combo's
 // contents.
 comp-$>$insertItems( someQStringList );
 \end{alltt}\normalsize 
}}

{\bf {\bf  To use your own completion object:}}

{\bf {\bf  \small\begin{alltt}
 KComboBox *combo = new KComboBox( this,"mywidget" );
 {\bf KURLCompletion} *comp = new KURLCompletion();
 combo-$>$setCompletionObject( comp );
 // Connect to the return pressed signal - optional
 connect(combo,SIGNAL({\bf returnPressed(const QString&)}{\rm (p.\,\pageref{classKComboBox_l1})}),comp,SLOT(addItem(const QString&));
 \end{alltt}\normalsize 
}}

{\bf {\bf  Note that you have to either delete the allocated completion object when you don't need it anymore, or call set\-Auto\-Delete\-Completion\-Object( true );}}

{\bf {\bf  Miscellaneous function calls:}}

{\bf {\bf  \small\begin{alltt}
 // Tell the widget not to handle completion and rotation
 combo-$>$setHandleSignals( false );
 // Set your own completion key for manual completions.
 combo-$>$setKeyBinding( KCompletionBase::TextCompletion, Qt::End );
 // Hide the context (popup) menu
 combo-$>$setContextMenuEnabled( false );
 \end{alltt}\normalsize 
}}

{\bf {\bf }}

{\bf {\bf \begin{Desc}
\item[Author:]Dawit Alemayehu $<${\tt adawit@kde.org}$>$ \end{Desc}
}}



Definition at line 121 of file kcombobox.h.

\subsection{Constructor \& Destructor Documentation}
\index{KComboBox@{KCombo\-Box}!KComboBox@{KComboBox}}
\index{KComboBox@{KComboBox}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KCombo\-Box::KCombo\-Box ({\bf QWidget} $\ast$ {\em parent} = 0, const char $\ast$ {\em name} = 0)}\label{classKComboBox_a0}


Constructs a read-only or rather select-only combo box with a parent object and a name. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em parent}]The parent object of this widget \item[{\em name}]The name of this widget \end{description}
\end{Desc}


Definition at line 60 of file kcombobox.cpp.

References KStd\-Accel::name().\index{KComboBox@{KCombo\-Box}!KComboBox@{KComboBox}}
\index{KComboBox@{KComboBox}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KCombo\-Box::KCombo\-Box (bool {\em rw}, {\bf QWidget} $\ast$ {\em parent} = 0, const char $\ast$ {\em name} = 0)}\label{classKComboBox_a1}


Constructs a \char`\"{}read-write\char`\"{} or \char`\"{}read-only\char`\"{} combo box depending on the value of the first argument( {\tt rw} ) with a parent, a name. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rw}]When {\tt true}, widget will be editable. \item[{\em parent}]The parent object of this widget. \item[{\em name}]The name of this widget. \end{description}
\end{Desc}


Definition at line 66 of file kcombobox.cpp.

References KStd\-Accel::name(), and QCombo\-Box::set\-Line\-Edit().\index{KComboBox@{KCombo\-Box}!~KComboBox@{$\sim$KComboBox}}
\index{~KComboBox@{$\sim$KComboBox}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KCombo\-Box::$\sim${\bf KCombo\-Box} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKComboBox_a2}


Destructor. 



Definition at line 78 of file kcombobox.cpp.

\subsection{Member Function Documentation}
\index{KComboBox@{KCombo\-Box}!setEditURL@{setEditURL}}
\index{setEditURL@{setEditURL}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::set\-Edit\-URL (const {\bf KURL} \& {\em url})}\label{classKComboBox_a3}


Sets {\tt url} into the edit field of the combobox. 

It uses {\bf KURL::pretty\-URL}() so that the url is properly decoded for displaying. 

Definition at line 207 of file kcombobox.cpp.

References KURL::pretty\-URL(), and QCombo\-Box::set\-Edit\-Text().\index{KComboBox@{KCombo\-Box}!insertURL@{insertURL}}
\index{insertURL@{insertURL}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::insert\-URL (const {\bf KURL} \& {\em url}, int {\em index} = -1)}\label{classKComboBox_a4}


Inserts {\tt url} at position {\tt index} into the combobox. 

The item will be appended if {\tt index} is negative. {\bf KURL::pretty\-URL}() is used so that the url is properly decoded for displaying. 

Definition at line 212 of file kcombobox.cpp.

References QCombo\-Box::insert\-Item(), and KURL::pretty\-URL().\index{KComboBox@{KCombo\-Box}!insertURL@{insertURL}}
\index{insertURL@{insertURL}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::insert\-URL (const {\bf QPixmap} \& {\em pixmap}, const {\bf KURL} \& {\em url}, int {\em index} = -1)}\label{classKComboBox_a5}


Inserts {\tt url} with the pixmap \&p pixmap at position {\tt index} into the combobox. 

The item will be appended if {\tt index} is negative. {\bf KURL::pretty\-URL}() is used so that the url is properly decoded for displaying. 

Definition at line 217 of file kcombobox.cpp.

References QCombo\-Box::insert\-Item(), and KURL::pretty\-URL().\index{KComboBox@{KCombo\-Box}!changeURL@{changeURL}}
\index{changeURL@{changeURL}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::change\-URL (const {\bf KURL} \& {\em url}, int {\em index})}\label{classKComboBox_a6}


Replaces the item at position {\tt index} with {\tt url}. 

{\bf KURL::pretty\-URL}() is used so that the url is properly decoded for displaying. 

Definition at line 222 of file kcombobox.cpp.

References QCombo\-Box::change\-Item(), and KURL::pretty\-URL().\index{KComboBox@{KCombo\-Box}!changeURL@{changeURL}}
\index{changeURL@{changeURL}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::change\-URL (const {\bf QPixmap} \& {\em pixmap}, const {\bf KURL} \& {\em url}, int {\em index})}\label{classKComboBox_a7}


Replaces the item at position {\tt index} with {\tt url} and pixmap {\tt pixmap}. 

{\bf KURL::pretty\-URL}() is used so that the url is properly decoded for displaying. 

Definition at line 227 of file kcombobox.cpp.

References QCombo\-Box::change\-Item(), and KURL::pretty\-URL().\index{KComboBox@{KCombo\-Box}!cursorPosition@{cursorPosition}}
\index{cursorPosition@{cursorPosition}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KCombo\-Box::cursor\-Position () const\hspace{0.3cm}{\tt  [inline]}}\label{classKComboBox_a8}


Returns the current cursor position. 

This method always returns a -1 if the combo-box is {\em not\/} editable (read-write).

\begin{Desc}
\item[Returns:]Current cursor position. \end{Desc}


Definition at line 199 of file kcombobox.h.

References QCombo\-Box::line\-Edit().\index{KComboBox@{KCombo\-Box}!setAutoCompletion@{setAutoCompletion}}
\index{setAutoCompletion@{setAutoCompletion}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::set\-Auto\-Completion (bool {\em autocomplete})\hspace{0.3cm}{\tt  [virtual]}}\label{classKComboBox_a9}


Re-implemented from {\bf QCombo\-Box}. 

If {\tt true}, the completion mode will be set to automatic. Otherwise, it is defaulted to the global setting. This method has been replaced by the more comprehensive {\bf set\-Completion\-Mode}().

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em autocomplete}]Flag to enable/disable automatic completion mode. \end{description}
\end{Desc}


Reimplemented from {\bf QCombo\-Box}.

Definition at line 117 of file kcombobox.cpp.

References KGlobal\-Settings::Completion\-Auto, KGlobal\-Settings::completion\-Mode(), and KCompletion\-Base::set\-Completion\-Mode().\index{KComboBox@{KCombo\-Box}!autoCompletion@{autoCompletion}}
\index{autoCompletion@{autoCompletion}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KCombo\-Box::auto\-Completion () const\hspace{0.3cm}{\tt  [inline]}}\label{classKComboBox_a10}


Re-implemented from {\bf QCombo\-Box}. 

Returns {\tt true} if the current completion mode is set to automatic. See its more comprehensive replacement {\bf completion\-Mode}().

\begin{Desc}
\item[Returns:]{\tt true} when completion mode is automatic. \end{Desc}


Reimplemented from {\bf QCombo\-Box}.

Definition at line 222 of file kcombobox.h.

References KGlobal\-Settings::Completion\-Auto, and KCompletion\-Base::completion\-Mode().\index{KComboBox@{KCombo\-Box}!setContextMenuEnabled@{setContextMenuEnabled}}
\index{setContextMenuEnabled@{setContextMenuEnabled}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::set\-Context\-Menu\-Enabled (bool {\em show\-Menu})\hspace{0.3cm}{\tt  [virtual]}}\label{classKComboBox_a11}


Enables or disable the popup (context) menu. 

This method only works if this widget is editable, i.e. read-write and allows you to enable/disable the context menu. It does nothing if invoked for a none-editable combo-box. Note that by default the mode changer item is made visiable whenever the context menu is enabled. Use hide\-Modechanger() if you want to hide this item. Also by default, the context menu is created if this widget is editable. Call this function with the argument set to false to disable the popup menu.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em show\-Menu}]If {\tt true}, show the context menu. \item[{\em show\-Mode}]If {\tt true}, show the mode changer. \end{description}
\end{Desc}


Definition at line 134 of file kcombobox.cpp.\index{KComboBox@{KCombo\-Box}!isContextMenuEnabled@{isContextMenuEnabled}}
\index{isContextMenuEnabled@{isContextMenuEnabled}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KCombo\-Box::is\-Context\-Menu\-Enabled () const\hspace{0.3cm}{\tt  [inline]}}\label{classKComboBox_a12}


Returns {\tt true} when the context menu is enabled. 



Definition at line 247 of file kcombobox.h.\index{KComboBox@{KCombo\-Box}!setURLDropsEnabled@{setURLDropsEnabled}}
\index{setURLDropsEnabled@{setURLDropsEnabled}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::set\-URLDrops\-Enabled (bool {\em enable})}\label{classKComboBox_a13}


Enables/Disables handling of URL drops. 

If enabled and the user drops an URL, the decoded URL will be inserted. Otherwise the default behaviour of {\bf QCombo\-Box} is used, which inserts the encoded URL.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em enable}]If {\tt true}, insert decoded URLs \end{description}
\end{Desc}


Definition at line 141 of file kcombobox.cpp.\index{KComboBox@{KCombo\-Box}!isURLDropsEnabled@{isURLDropsEnabled}}
\index{isURLDropsEnabled@{isURLDropsEnabled}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KCombo\-Box::is\-URLDrops\-Enabled () const}\label{classKComboBox_a14}


Returns {\tt true} when decoded URL drops are enabled. 



Definition at line 147 of file kcombobox.cpp.\index{KComboBox@{KCombo\-Box}!contains@{contains}}
\index{contains@{contains}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KCombo\-Box::contains (const {\bf QString} \& {\em text}) const}\label{classKComboBox_a15}


Convenience method which iterates over all items and checks if any of them is equal to {\tt text}. 

If {\tt text} is an empty string, {\tt false} is returned.

\begin{Desc}
\item[Returns:]{\tt true} if an item with the string {\tt text} is in the combobox. \end{Desc}


Definition at line 104 of file kcombobox.cpp.

References QCombo\-Box::count(), QString::is\-Empty(), and QCombo\-Box::text().

Referenced by KHistory\-Combo::add\-To\-History().\index{KComboBox@{KCombo\-Box}!setTrapReturnKey@{setTrapReturnKey}}
\index{setTrapReturnKey@{setTrapReturnKey}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::set\-Trap\-Return\-Key (bool {\em trap})}\label{classKComboBox_a16}


By default, KCombo\-Box recognizes Key\_\-Return and Key\_\-Enter and emits the {\bf return\-Pressed}{\rm (p.\,\pageref{classKComboBox_l0})}() signals, but it also lets the event pass, for example causing a dialog's default-button to be called. 

Call this method with {\tt trap} equal to true to make KCombo\-Box stop these events. The signals will still be emitted of course.

Only affects read-writable comboboxes.

\begin{Desc}
\item[See also:]{\bf set\-Trap\-Return\-Key()}{\rm (p.\,\pageref{classKComboBox_a16})} \end{Desc}


Definition at line 193 of file kcombobox.cpp.\index{KComboBox@{KCombo\-Box}!trapReturnKey@{trapReturnKey}}
\index{trapReturnKey@{trapReturnKey}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KCombo\-Box::trap\-Return\-Key () const}\label{classKComboBox_a17}


\begin{Desc}
\item[Returns:]{\tt true} if keyevents of Key\_\-Return or Key\_\-Enter will be stopped or if they will be propagated.\end{Desc}
\begin{Desc}
\item[See also:]{\bf set\-Trap\-Return\-Key}{\rm (p.\,\pageref{classKComboBox_a16})} () \end{Desc}


Definition at line 201 of file kcombobox.cpp.\index{KComboBox@{KCombo\-Box}!eventFilter@{eventFilter}}
\index{eventFilter@{eventFilter}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KCombo\-Box::event\-Filter ({\bf QObject} $\ast$, {\bf QEvent} $\ast$)\hspace{0.3cm}{\tt  [virtual]}}\label{classKComboBox_a18}


Re-implemented for internal reasons. 

API not affected. 

Definition at line 188 of file kcombobox.cpp.\index{KComboBox@{KCombo\-Box}!completionBox@{completionBox}}
\index{completionBox@{completionBox}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KCompletion\-Box} $\ast$ KCombo\-Box::completion\-Box (bool {\em create} = true)}\label{classKComboBox_a19}


\begin{Desc}
\item[Returns:]the completion-box, that is used in completion mode {\bf KGlobal\-Settings::Completion\-Popup} and {\bf KGlobal\-Settings::Completion\-Popup\-Auto}. This method will create a completion-box by calling {\bf KLine\-Edit::completion\-Box}{\rm (p.\,\pageref{classKLineEdit_a13})}, if none is there, yet.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em create}]Set this to false if you don't want the box to be created i.e. to test if it is available. \end{description}
\end{Desc}


Definition at line 238 of file kcombobox.cpp.

References KStd\-Action::create().\index{KComboBox@{KCombo\-Box}!returnPressed@{returnPressed}}
\index{returnPressed@{returnPressed}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::return\-Pressed ()\hspace{0.3cm}{\tt  [signal]}}\label{classKComboBox_l0}


Emitted when the user presses the Enter key. 

Note that this signal is only emitted if this widget is editable. \index{KComboBox@{KCombo\-Box}!returnPressed@{returnPressed}}
\index{returnPressed@{returnPressed}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::return\-Pressed (const {\bf QString} \&)\hspace{0.3cm}{\tt  [signal]}}\label{classKComboBox_l1}


Emitted when the user presses the Enter key. 

The argument is the current text being edited. This signal is just like {\bf return\-Pressed}{\rm (p.\,\pageref{classKComboBox_l0})}() except it contains the current text as its argument.

Note that this signal is only emitted if this widget is editable. \index{KComboBox@{KCombo\-Box}!completion@{completion}}
\index{completion@{completion}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::completion (const {\bf QString} \&)\hspace{0.3cm}{\tt  [signal]}}\label{classKComboBox_l2}


This signal is emitted when the completion key is pressed. 

The argument is the current text being edited.

Note that this signal is {\em not\/} available if this widget is non-editable or the completion mode is set to {\tt {\bf KGlobal\-Settings::Completion\-None}}. \index{KComboBox@{KCombo\-Box}!substringCompletion@{substringCompletion}}
\index{substringCompletion@{substringCompletion}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::substring\-Completion (const {\bf QString} \&)\hspace{0.3cm}{\tt  [signal]}}\label{classKComboBox_l3}


Emitted when the shortcut for substring completion is pressed. 

\index{KComboBox@{KCombo\-Box}!textRotation@{textRotation}}
\index{textRotation@{textRotation}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::text\-Rotation ({\bf KCompletion\-Base::Key\-Binding\-Type})\hspace{0.3cm}{\tt  [signal]}}\label{classKComboBox_l4}


Emitted when the text rotation key-bindings are pressed. 

The argument indicates which key-binding was pressed. In this case this can be either one of four values: {\tt Prev\-Completion\-Match}, {\tt Next\-Completion\-Match}, {\tt Rotate\-Up} or {\tt Rotate\-Down}. See {\bf KCompletion\-Base::set\-Key\-Binding}() for details.

Note that this signal is {\em NOT\/} emitted if the completion mode is set to Completion\-None. \index{KComboBox@{KCombo\-Box}!completionModeChanged@{completionModeChanged}}
\index{completionModeChanged@{completionModeChanged}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::completion\-Mode\-Changed ({\bf KGlobal\-Settings::Completion})\hspace{0.3cm}{\tt  [signal]}}\label{classKComboBox_l5}


Emitted when the user changed the completion mode by using the popupmenu. 

\index{KComboBox@{KCombo\-Box}!aboutToShowContextMenu@{aboutToShowContextMenu}}
\index{aboutToShowContextMenu@{aboutToShowContextMenu}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::about\-To\-Show\-Context\-Menu ({\bf QPopup\-Menu} $\ast$)\hspace{0.3cm}{\tt  [signal]}}\label{classKComboBox_l6}


Emitted before the context menu is displayed. 

The signal allows you to add your own entries into the the context menu that is created on demand.

NOTE: Do not store the pointer to the {\bf QPopup\-Menu} provided through since it is created and deleted on demand.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em the}]context menu about to be displayed \end{description}
\end{Desc}
\index{KComboBox@{KCombo\-Box}!rotateText@{rotateText}}
\index{rotateText@{rotateText}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::rotate\-Text ({\bf KCompletion\-Base::Key\-Binding\-Type})\hspace{0.3cm}{\tt  [slot]}}\label{classKComboBox_i0}


Iterates through all possible matches of the completed text or the history list. 

Depending on the value of the argument, this function either iterates through the history list of this widget or the all possible matches in whenever multiple matches result from a text completion request. Note that the all-possible-match iteration will not work if there are no previous matches, i.e. no text has been completed and the $\ast$nix shell history list rotation is only available if the insertion policy for this widget is set either {\tt QComob\-Box::At\-Top} or {\tt QCombo\-Box::At\-Bottom}. For other insertion modes whatever has been typed by the user when the rotation event was initiated will be lost.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em type}]The key-binding invoked. \end{description}
\end{Desc}


Definition at line 181 of file kcombobox.cpp.\index{KComboBox@{KCombo\-Box}!setCompletedText@{setCompletedText}}
\index{setCompletedText@{setCompletedText}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::set\-Completed\-Text (const {\bf QString} \&)\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKComboBox_i1}


Sets the completed text in the line-edit appropriately. 

This function is an implementation for {\bf KCompletion\-Base::set\-Completed\-Text}. 

Implements {\bf KCompletion\-Base}.

Definition at line 159 of file kcombobox.cpp.\index{KComboBox@{KCombo\-Box}!setCompletedItems@{setCompletedItems}}
\index{setCompletedItems@{setCompletedItems}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::set\-Completed\-Items (const {\bf QString\-List} \& {\em items})\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKComboBox_i2}


Sets {\tt items} into the completion-box if {\bf completion\-Mode}() is Completion\-Popup. 

The popup will be shown immediately. 

Implements {\bf KCompletion\-Base}.

Definition at line 232 of file kcombobox.cpp.\index{KComboBox@{KCombo\-Box}!setCurrentItem@{setCurrentItem}}
\index{setCurrentItem@{setCurrentItem}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::set\-Current\-Item (const {\bf QString} \& {\em item}, bool {\em insert} = false, int {\em index} = -1)\hspace{0.3cm}{\tt  [slot]}}\label{classKComboBox_i3}


Selects the first item that matches {\tt item}. 

If there is no such item, it is inserted at position {\tt index} if {\tt insert} is true. Otherwise, no item is selected. 

Definition at line 315 of file kcombobox.cpp.

References QCombo\-Box::count(), KStd\-Accel::insert(), QCombo\-Box::insert\-Item(), and QCombo\-Box::text().

Referenced by KHistory\-Combo::add\-To\-History(), make\-Completion(), and KFont\-Combo::set\-Current\-Font().\index{KComboBox@{KCombo\-Box}!itemSelected@{itemSelected}}
\index{itemSelected@{itemSelected}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KCombo\-Box::item\-Selected ({\bf QList\-Box\-Item} $\ast$)\hspace{0.3cm}{\tt  [inline, protected, virtual, slot]}}\label{classKComboBox_j0}


{\bf This class or method is obsolete, it is provided for compatibility only.}. 



Definition at line 441 of file kcombobox.h.\index{KComboBox@{KCombo\-Box}!makeCompletion@{makeCompletion}}
\index{makeCompletion@{makeCompletion}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::make\-Completion (const {\bf QString} \&)\hspace{0.3cm}{\tt  [protected, virtual, slot]}}\label{classKComboBox_j1}


Completes text according to the completion mode. 

Note: this method is {\tt not} invoked if the completion mode is set to Completion\-None. Also if the mode is set to {\tt Completion\-Shell} and multiple matches are found, this method will complete the text to the first match with a beep to inidicate that there are more matches. Then any successive completion key event iterates through the remaining matches. This way the rotation functionality is left to iterate through the list as usual. 

Definition at line 165 of file kcombobox.cpp.

References QString::is\-Null(), QCombo\-Box::list\-Box(), and set\-Current\-Item().\index{KComboBox@{KCombo\-Box}!create@{create}}
\index{create@{create}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::create (WId = 0, bool {\em initialize\-Window} = true, bool {\em destroy\-Old\-Window} = true)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKComboBox_b1}


Reimplemented for internal reasons, the API is not affected. 



Definition at line 246 of file kcombobox.cpp.

References QCombo\-Box::line\-Edit(), and KCursor::set\-Auto\-Hide\-Cursor().

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