\section{KCombo\-Box Class Reference}
\label{classKComboBox}\index{KComboBox@{KComboBox}}
An enhanced combo box.  


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

Inheritance diagram for KCombo\-Box:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=162pt]{classKComboBox__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KCombo\-Box:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=111pt]{classKComboBox__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
void {\bf rotate\-Text} ({\bf KCompletion\-Base::Key\-Binding\-Type} type)
\item 
virtual void {\bf set\-Completed\-Text} (const {\bf QString} \&)
\item 
void {\bf set\-Completed\-Items} (const {\bf QString\-List} \&items)
\item 
void {\bf set\-Current\-Item} (const {\bf QString} \&item, bool insert=false, int index=-1)
\item 
void {\bf set\-Current\-Item} (int index)
\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf return\-Pressed} ()
\item 
void {\bf return\-Pressed} (const {\bf QString} \&)
\item 
void {\bf completion} (const {\bf QString} \&)
\item 
void {\bf substring\-Completion} (const {\bf QString} \&)
\item 
void {\bf text\-Rotation} ({\bf KCompletion\-Base::Key\-Binding\-Type})
\item 
void {\bf completion\-Mode\-Changed} ({\bf KGlobal\-Settings::Completion})
\item 
void {\bf about\-To\-Show\-Context\-Menu} ({\bf QPopup\-Menu} $\ast$p)
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KCombo\-Box} ({\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
{\bf KCombo\-Box} (bool rw, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
virtual {\bf $\sim$KCombo\-Box} ()
\item 
void {\bf set\-Edit\-URL} (const {\bf KURL} \&url)
\item 
void {\bf insert\-URL} (const {\bf KURL} \&url, int index=-1)
\item 
void {\bf insert\-URL} (const {\bf QPixmap} \&{\bf pixmap}, const {\bf KURL} \&url, int index=-1)
\item 
void {\bf change\-URL} (const {\bf KURL} \&url, int index)
\item 
void {\bf change\-URL} (const {\bf QPixmap} \&{\bf pixmap}, const {\bf KURL} \&url, int index)
\item 
int {\bf cursor\-Position} () const 
\item 
virtual void {\bf set\-Auto\-Completion} (bool autocomplete)
\item 
bool {\bf auto\-Completion} () const 
\item 
virtual void {\bf set\-Context\-Menu\-Enabled} (bool show\-Menu)
\item 
bool {\bf is\-Context\-Menu\-Enabled} () const 
\item 
void {\bf set\-URLDrops\-Enabled} (bool enable)
\item 
bool {\bf is\-URLDrops\-Enabled} () const 
\item 
bool {\bf contains} (const {\bf QString} \&{\bf text}) const 
\item 
void {\bf set\-Trap\-Return\-Key} (bool trap)
\item 
bool {\bf trap\-Return\-Key} () const 
\item 
virtual bool {\bf event\-Filter} ({\bf QObject} $\ast$, {\bf QEvent} $\ast$)
\item 
{\bf KCompletion\-Box} $\ast$ {\bf completion\-Box} (bool create=true)
\item 
virtual void {\bf set\-Line\-Edit} ({\bf QLine\-Edit} $\ast$)
\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
virtual void {\bf item\-Selected} ({\bf QList\-Box\-Item} $\ast$)
\item 
virtual void {\bf make\-Completion} (const {\bf QString} \&)
\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)
\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*{Properties}
\begin{CompactItemize}
\item 
bool {\bf auto\-Completion}\label{classKComboBox_00}

\item 
bool {\bf context\-Menu\-Enabled}\label{classKComboBox_01}

\item 
bool {\bf url\-Drops\-Enabled}\label{classKComboBox_02}

\item 
bool {\bf trap\-Return\-Key}\label{classKComboBox_03}

\end{CompactItemize}


\subsection{Detailed Description}
An enhanced combo box. 

A combined button, line-edit and a popup list widget.

{\bf Detail} \par


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.

To support these new features KCombo\-Box emits a few additional signals such as {\bf completion( const QString\& )}{\rm (p.\,\pageref{classKComboBox_l2})} and text\-Rotation( 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( const QString\& )}{\rm (p.\,\pageref{classKComboBox_l1})} signals are emitted when the user presses the Enter/Return key.

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.

Beware: The completion object can be deleted on you, especially if a call such as set\-Editable(false) is made. Store the pointer at your own risk, and consider using QGuarded\-Ptr$<$KCompletion$>$.

The default key-bindings for completion and rotation is determined from the global settings in {\bf KStd\-Accel}. These values, however, can be overridden 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.

A non-editable combobox only has one completion mode, {\tt Completion\-Auto}. Unlike an editable combobox the Completion\-Auto mode, works by matching any typed key with the first letter of entries in the combobox. Please note that if you call set\-Editable( false ) to change an editable combobox to a non-editable one, the text completion object associated with the combobox will no longer exist unless you created the completion object yourself and assigned it to this widget or you called set\-Auto\-Delete\-Completion\-Object( false ). In other words do not do the following:



\footnotesize\begin{verbatim} KComboBox* combo = new KCompletionBox(true, this, "mywidget");
 KCompletion* comp = combo->completionObject();
 combo->setEditable( false );
 comp->clear(); // CRASH: completion object does not exist anymore.
\end{verbatim}
\normalsize


A read-only KCombo\-Box will have the same background color as a disabled KCombo\-Box, but its foreground color will be the one used for the read-write mode. This differs from QCombo\-Box's implementation and is done to give visual distinction between the three different modes: disabled, read-only, and read-write.

{\bf Usage} \par


To enable the basic completion feature:



\footnotesize\begin{verbatim} KComboBox *combo = new KComboBox( true, this, "mywidget" );
 KCompletion *comp = combo->completionObject();
 // Connect to the return pressed signal - optional
 connect(combo,SIGNAL(returnPressed(const QString&)),comp,SLOT(addItem(const QString&)));

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


To use your own completion object:



\footnotesize\begin{verbatim} KComboBox *combo = new KComboBox( this,"mywidget" );
 KURLCompletion *comp = new KURLCompletion();
 combo->setCompletionObject( comp );
 // Connect to the return pressed signal - optional
 connect(combo,SIGNAL(returnPressed(const QString&)),comp,SLOT(addItem(const QString&)));
\end{verbatim}
\normalsize


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 );

Miscellaneous function calls:



\footnotesize\begin{verbatim} // 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{verbatim}
\normalsize


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




Definition at line 144 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} = {\tt 0}, const char $\ast$ {\em name} = {\tt 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 59 of file kcombobox.cpp.\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} = {\tt 0}, const char $\ast$ {\em name} = {\tt 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 65 of file kcombobox.cpp.

References 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 77 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 197 of file kcombobox.cpp.

References 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} = {\tt -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 202 of file kcombobox.cpp.

References QCombo\-Box::insert\-Item().\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} = {\tt -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 207 of file kcombobox.cpp.

References QCombo\-Box::insert\-Item().\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 212 of file kcombobox.cpp.

References QCombo\-Box::change\-Item().\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 217 of file kcombobox.cpp.

References QCombo\-Box::change\-Item().\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 223 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 107 of file kcombobox.cpp.

References 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 246 of file kcombobox.h.

References 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. \end{description}
\end{Desc}


Definition at line 124 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 270 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 behavior 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 131 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 137 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 93 of file kcombobox.cpp.

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

Referenced by KHistory\-Combo::add\-To\-History(), and KHistory\-Combo::key\-Press\-Event().\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 183 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}
\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 178 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} = {\tt 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 228 of file kcombobox.cpp.\index{KComboBox@{KCombo\-Box}!setLineEdit@{setLineEdit}}
\index{setLineEdit@{setLineEdit}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::set\-Line\-Edit ({\bf QLine\-Edit} $\ast$)\hspace{0.3cm}{\tt  [virtual]}}\label{classKComboBox_a20}


Re-implemented for internal reasons. 

API remains unaffected. NOTE: Only editable comboboxes can have a line editor. As such any attempt to assign a line-edit to a non-editable combobox will simply be ignored. 

Reimplemented from {\bf QCombo\-Box}.

Definition at line 248 of file kcombobox.cpp.

References about\-To\-Show\-Context\-Menu(), QCombo\-Box::activated(), completion(), completion\-Mode\-Changed(), QCombo\-Box::editable(), return\-Pressed(), KCompletion\-Base::set\-Delegate(), QCombo\-Box::set\-Line\-Edit(), substring\-Completion(), and text\-Rotation().

Referenced by KCombo\-Box().\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 when the widget is editable. 

Referenced by set\-Line\-Edit().\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 when the 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}


Emitted when the completion key is pressed. 

The argument is the current text being edited.

Note that this signal is {\em not\/} available when the widget is non-editable or the completion mode is set to {\tt {\bf KGlobal\-Settings::Completion\-None}}. 

Referenced by set\-Line\-Edit().\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. 



Referenced by set\-Line\-Edit().\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. 

Referenced by set\-Line\-Edit().\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 whenever the completion mode is changed by the user through the context menu. 



Referenced by set\-Line\-Edit().\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$ {\em p})\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 context menu. Note that you MUST NOT store the pointer to the {\bf QPopup\-Menu} since it is created and deleted on demand. Otherwise, you can crash your app.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em p}]the context menu about to be displayed \end{description}
\end{Desc}


Referenced by set\-Line\-Edit().\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} {\em 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 171 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 149 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 222 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} = {\tt false}, int {\em index} = {\tt -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 305 of file kcombobox.cpp.

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

Referenced by KHistory\-Combo::add\-To\-History(), make\-Completion(), and KTool\-Bar::set\-Current\-Combo\-Item().\index{KComboBox@{KCombo\-Box}!setCurrentItem@{setCurrentItem}}
\index{setCurrentItem@{setCurrentItem}!KComboBox@{KCombo\-Box}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KCombo\-Box::set\-Current\-Item (int {\em index})\hspace{0.3cm}{\tt  [inline, slot]}}\label{classKComboBox_i4}


Simply calls QCombo\-Box' implementation. 

Only here to not become shadowed. 

Reimplemented from {\bf QCombo\-Box}.

Reimplemented in {\bf KFont\-Combo} {\rm (p.\,\pageref{classKFontCombo_a16})}.

Definition at line 453 of file kcombobox.h.

References QCombo\-Box::set\-Current\-Item().\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}


\begin{Desc}
\item[{\bf Deprecated}]\end{Desc}


Definition at line 460 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 155 of file kcombobox.cpp.

References 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 = {\tt 0}, bool {\em initialize\-Window} = {\tt true}, bool {\em destroy\-Old\-Window} = {\tt true})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKComboBox_b1}


Reimplemented for internal reasons, the API is not affected. 



Definition at line 236 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}
