\section{KLine\-Edit Class Reference}
\label{classKLineEdit}\index{KLineEdit@{KLineEdit}}
An enhanced {\bf QLine\-Edit} widget for inputting text. An enhanced single line input widget.  


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

Inheritance diagram for KLine\-Edit:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=125pt]{classKLineEdit__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KLine\-Edit:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=168pt]{classKLineEdit__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
virtual void {\bf set\-Read\-Only} (bool)
\begin{CompactList}\small\item\em Re-implemented for internal reasons. \item\end{CompactList}\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 See {\bf KCompletion\-Base::set\-Completed\-Text}. \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 
virtual void {\bf clear} ()
\begin{CompactList}\small\item\em Reimplemented to workaround a buggy {\bf QLine\-Edit::clear()} (changing the clipboard to the text we just had in the lineedit). \item\end{CompactList}\item 
void {\bf set\-Squeezed\-Text} (const  {\bf QString} \&{\bf text})
\begin{CompactList}\small\item\em Squeezes {\tt text} into the line edit. \item\end{CompactList}\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf completion\-Box\-Activated} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Emitted whenever the completion box is activated. \item\end{CompactList}\item 
void {\bf return\-Pressed} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Emitted when the user presses the return key. \item\end{CompactList}\item 
void {\bf completion} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em 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 KLine\-Edit} (const  {\bf QString} \&string, {\bf QWidget} $\ast$parent, const  char $\ast$name=0)
\begin{CompactList}\small\item\em Constructs a KLine\-Edit object with a default text, a parent, and a name. \item\end{CompactList}\item 
{\bf KLine\-Edit} ({\bf QWidget} $\ast$parent=0, const  char $\ast$name=0)
\begin{CompactList}\small\item\em Constructs a KLine\-Edit object with a parent and a name. \item\end{CompactList}\item 
virtual {\bf $\sim$KLine\-Edit} ()
\begin{CompactList}\small\item\em Destructor. \item\end{CompactList}\item 
void {\bf set\-URL} (const  {\bf KURL} \&url)
\begin{CompactList}\small\item\em Sets {\tt url} into the lineedit. \item\end{CompactList}\item 
void {\bf cursor\-At\-End} ()
\begin{CompactList}\small\item\em Puts the text cursor at the end of the string. \item\end{CompactList}\item 
virtual void {\bf set\-Completion\-Mode} ({\bf KGlobal\-Settings::Completion} mode)
\begin{CompactList}\small\item\em Re-implemented from {\bf KCompletion\-Base} for internal reasons. \item\end{CompactList}\item 
virtual void {\bf set\-Context\-Menu\-Enabled} (bool show\-Menu)
\begin{CompactList}\small\item\em Enables/disables 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 
void {\bf set\-Trap\-Return\-Key} (bool trap)
\begin{CompactList}\small\item\em By default, KLine\-Edit recognizes {\tt Key\_\-Return} and {\tt Key\_\-Enter} and emits the {\bf return\-Pressed}{\rm (p.\,\pageref{classKLineEdit_l1})}() 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\-Completion\-Object} ({\bf KCompletion} $\ast$, bool hsig=true)
\begin{CompactList}\small\item\em Reimplemented for internal reasons, the API is not affected. \item\end{CompactList}\item 
virtual void {\bf copy} () const 
\begin{CompactList}\small\item\em Reimplemented for internal reasons, the API is not affected. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
virtual void {\bf make\-Completion} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Completes the remaining text with a matching one from a given list. \item\end{CompactList}\item 
void {\bf slot\-About\-To\-Show} ()
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.}. \item\end{CompactList}\item 
void {\bf slot\-Cancelled} ()
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf resize\-Event} ({\bf QResize\-Event} $\ast$)
\begin{CompactList}\small\item\em Re-implemented for internal reasons. \item\end{CompactList}\item 
virtual void {\bf key\-Press\-Event} ({\bf QKey\-Event} $\ast$)
\begin{CompactList}\small\item\em Re-implemented for internal reasons. \item\end{CompactList}\item 
virtual void {\bf mouse\-Press\-Event} ({\bf QMouse\-Event} $\ast$)
\begin{CompactList}\small\item\em Re-implemented for internal reasons. \item\end{CompactList}\item 
virtual void {\bf mouse\-Double\-Click\-Event} ({\bf QMouse\-Event} $\ast$)
\begin{CompactList}\small\item\em Re-implemented for internal reasons. \item\end{CompactList}\item 
virtual {\bf QPopup\-Menu} $\ast$ {\bf create\-Popup\-Menu} ()
\begin{CompactList}\small\item\em Re-implemented for internal reasons. \item\end{CompactList}\item 
virtual void {\bf drop\-Event} ({\bf QDrop\-Event} $\ast$)
\begin{CompactList}\small\item\em Re-implemented to handle URI drops. \item\end{CompactList}\item 
virtual void {\bf set\-Completed\-Text} (const  {\bf QString} \&, bool)\label{classKLineEdit_b6}

\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 virtual\_\-hook} (int id, void $\ast$data)\label{classKLineEdit_b8}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf KCombo\-Box}\label{classKLineEdit_n0}

\end{CompactItemize}


\subsection{Detailed Description}
An enhanced {\bf QLine\-Edit} widget for inputting text. An enhanced single line input widget. 

{\bf  Detail}

{\bf  This widget inherits from {\bf QLine\-Edit} and implements the following additional functionalities: a completion object that provides both automatic and manual text completion as well as multiple match iteration features, configurable key-bindings to activate these features and a popup-menu item that can be used to allow the user to set text completion modes on the fly based on their preference.}

{\bf  To support these new features KLine\-Edit also emits a few more additional signals. These are: {\bf completion}{\rm (p.\,\pageref{classKLineEdit_l2})}( const {\bf QString}\& ), {\bf text\-Rotation( Key\-Binding\-Type )}{\rm (p.\,\pageref{classKLineEdit_l4})}, and {\bf return\-Pressed}{\rm (p.\,\pageref{classKLineEdit_l1})}( const {\bf QString}\& ). The completion signal can be connected to a slot that will assist the user in filling out the remaining text. The text rotation signal is intended to be used to iterate through the list of all possible matches whenever there is more than one match for the entered text. The {\tt {\bf return\-Pressed( const QString\& )}{\rm (p.\,\pageref{classKLineEdit_l1})}} signals are the same as {\bf QLine\-Edit}'s except it provides the current text in the widget as its argument whenever appropriate.}

{\bf  This widget by default creates a completion object when you invoke the {\bf completion\-Object}( bool ) member function for the first time or use {\bf set\-Completion\-Object}{\rm (p.\,\pageref{classKLineEdit_a14})}( KCompletion$\ast$, bool ) to assign your own completion object. Additionally, to make this widget more functional, KLine\-Edit will by default handle the text rotation and completion events internally when 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 set the boolean parameter in the above functions 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  NOTE that if the {\tt Echo\-Mode} for this widget is set to something other than {\tt QLine\-Edit::Normal}, the completion mode will always be defaulted to {\bf KGlobal\-Settings::Completion\-None}. This is done purposefully to guard against protected entries such as passwords being cached in {\bf KCompletion}'s list. Hence, if the {\tt Echo\-Mode} is not QLine\-Edit::Normal, the completion mode is automatically disabled.}

{\bf  }

{\bf {\bf  Usage}}

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

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

{\bf {\bf  To use a customized completion objects or your own completion object :}}

{\bf {\bf  \small\begin{alltt}
 KLineEdit *edit = new KLineEdit( this,"mywidget" );
 {\bf KURLCompletion} *comp = new KURLCompletion();
 edit-$>$setCompletionObject( comp );
 // Connect to the return pressed signal - optional
 connect(edit,SIGNAL({\bf returnPressed(const QString&)}{\rm (p.\,\pageref{classKLineEdit_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  }}

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

{\bf {\bf {\bf  \small\begin{alltt}
 // Tell the widget not to handle completion and
 // iteration internally.
 edit-$>$setHandleSignals( false );
 // Set your own completion key for manual completions.
 edit-$>$setKeyBinding( KCompletionBase::TextCompletion, Qt::End );
 // Hide the context (popup) menu
 edit-$>$setContextMenuEnabled( false );
 // Temporarly disable signal emitions
 // (both completion \& iteration signals)
 edit-$>$disableSignals();
 // Default the key-bindings to system settings.
 edit-$>${\bf useGlobalKeyBindings()};
 \end{alltt}\normalsize 
}}}

{\bf {\bf {\bf }}}

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



Definition at line 136 of file klineedit.h.

\subsection{Constructor \& Destructor Documentation}
\index{KLineEdit@{KLine\-Edit}!KLineEdit@{KLineEdit}}
\index{KLineEdit@{KLineEdit}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KLine\-Edit::KLine\-Edit (const {\bf QString} \& {\em string}, {\bf QWidget} $\ast$ {\em parent}, const char $\ast$ {\em name} = 0)}\label{classKLineEdit_a0}


Constructs a KLine\-Edit object with a default text, a parent, and a name. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em string}]Text to be shown in the edit widget. \item[{\em parent}]The parent object of this widget. \item[{\em name}]the name of this widget \end{description}
\end{Desc}


Definition at line 71 of file klineedit.cpp.

References KStd\-Accel::name().\index{KLineEdit@{KLine\-Edit}!KLineEdit@{KLineEdit}}
\index{KLineEdit@{KLineEdit}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KLine\-Edit::KLine\-Edit ({\bf QWidget} $\ast$ {\em parent} = 0, const char $\ast$ {\em name} = 0)}\label{classKLineEdit_a1}


Constructs a KLine\-Edit object with a parent and a name. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em string}]Text to be shown in the edit widget. \item[{\em parent}]The parent object of this widget. \item[{\em name}]The name of this widget. \end{description}
\end{Desc}


Definition at line 77 of file klineedit.cpp.

References KStd\-Accel::name().\index{KLineEdit@{KLine\-Edit}!~KLineEdit@{$\sim$KLineEdit}}
\index{~KLineEdit@{$\sim$KLineEdit}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KLine\-Edit::$\sim${\bf KLine\-Edit} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKLineEdit_a2}


Destructor. 



Definition at line 83 of file klineedit.cpp.

\subsection{Member Function Documentation}
\index{KLineEdit@{KLine\-Edit}!setURL@{setURL}}
\index{setURL@{setURL}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::set\-URL (const {\bf KURL} \& {\em url})}\label{classKLineEdit_a3}


Sets {\tt url} into the lineedit. 

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

Definition at line 738 of file klineedit.cpp.

References KURL::pretty\-URL(), and QLine\-Edit::set\-Text().\index{KLineEdit@{KLine\-Edit}!cursorAtEnd@{cursorAtEnd}}
\index{cursorAtEnd@{cursorAtEnd}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::cursor\-At\-End ()\hspace{0.3cm}{\tt  [inline]}}\label{classKLineEdit_a4}


Puts the text cursor at the end of the string. 

This method is deprecated. Use {\bf QLine\-Edit::end}() instead.

{\bf This class or method is obsolete, it is provided for compatibility only.} {\bf QLine\-Edit::end}() 

Definition at line 185 of file klineedit.h.

References QLine\-Edit::end().\index{KLineEdit@{KLine\-Edit}!setCompletionMode@{setCompletionMode}}
\index{setCompletionMode@{setCompletionMode}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::set\-Completion\-Mode ({\bf KGlobal\-Settings::Completion} {\em mode})\hspace{0.3cm}{\tt  [virtual]}}\label{classKLineEdit_a5}


Re-implemented from {\bf KCompletion\-Base} for internal reasons. 

This function is re-implemented in order to make sure that the Echo\-Mode is acceptable before we set the completion mode.

See {\bf KCompletion\-Base::set\-Completion\-Mode} 

Reimplemented from {\bf KCompletion\-Base}.

Definition at line 100 of file klineedit.cpp.

References KGlobal\-Settings::Completion, KCompletion\-Base::completion\-Mode(), KGlobal\-Settings::Completion\-None, KGlobal\-Settings::Completion\-Popup, QLine\-Edit::echo\-Mode(), and KCompletion\-Base::set\-Completion\-Mode().\index{KLineEdit@{KLine\-Edit}!setContextMenuEnabled@{setContextMenuEnabled}}
\index{setContextMenuEnabled@{setContextMenuEnabled}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual void KLine\-Edit::set\-Context\-Menu\-Enabled (bool {\em show\-Menu})\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classKLineEdit_a6}


Enables/disables the popup (context) menu. 

Note that when this function is invoked with its argument set to {\tt true}, then both the context menu and the completion menu item are enabled. If you do not want to the completion item to be visible simply invoke hide\-Modechanger() right after calling this method. Also by default, the context menu is automatically created if this widget is editable. Thus you need to call this function with the argument set to false if you do not want this behaviour.

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


Definition at line 211 of file klineedit.h.\index{KLineEdit@{KLine\-Edit}!isContextMenuEnabled@{isContextMenuEnabled}}
\index{isContextMenuEnabled@{isContextMenuEnabled}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KLine\-Edit::is\-Context\-Menu\-Enabled () const\hspace{0.3cm}{\tt  [inline]}}\label{classKLineEdit_a7}


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



Definition at line 216 of file klineedit.h.\index{KLineEdit@{KLine\-Edit}!setURLDropsEnabled@{setURLDropsEnabled}}
\index{setURLDropsEnabled@{setURLDropsEnabled}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::set\-URLDrops\-Enabled (bool {\em enable})}\label{classKLineEdit_a8}


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 QLine\-Edit} 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 718 of file klineedit.cpp.\index{KLineEdit@{KLine\-Edit}!isURLDropsEnabled@{isURLDropsEnabled}}
\index{isURLDropsEnabled@{isURLDropsEnabled}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KLine\-Edit::is\-URLDrops\-Enabled () const}\label{classKLineEdit_a9}


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



Definition at line 723 of file klineedit.cpp.\index{KLineEdit@{KLine\-Edit}!setTrapReturnKey@{setTrapReturnKey}}
\index{setTrapReturnKey@{setTrapReturnKey}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::set\-Trap\-Return\-Key (bool {\em trap})}\label{classKLineEdit_a10}


By default, KLine\-Edit recognizes {\tt Key\_\-Return} and {\tt Key\_\-Enter} and emits the {\bf return\-Pressed}{\rm (p.\,\pageref{classKLineEdit_l1})}() 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} = {\tt true} to make {\tt KLine\-Edit} stop these events. The signals will still be emitted of course.

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


Definition at line 728 of file klineedit.cpp.\index{KLineEdit@{KLine\-Edit}!trapReturnKey@{trapReturnKey}}
\index{trapReturnKey@{trapReturnKey}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KLine\-Edit::trap\-Return\-Key () const}\label{classKLineEdit_a11}


\begin{Desc}
\item[Returns:]{\tt true} if keyevents of {\tt Key\_\-Return} or {\tt 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{classKLineEdit_a10})} () \end{Desc}


Definition at line 733 of file klineedit.cpp.\index{KLineEdit@{KLine\-Edit}!eventFilter@{eventFilter}}
\index{eventFilter@{eventFilter}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KLine\-Edit::event\-Filter ({\bf QObject} $\ast$, {\bf QEvent} $\ast$)\hspace{0.3cm}{\tt  [virtual]}}\label{classKLineEdit_a12}


Re-implemented for internal reasons. 

API not affected. 

Definition at line 676 of file klineedit.cpp.

References QKey\-Event::accept(), KCursor::auto\-Hide\-Event\-Filter(), QLine\-Edit::display\-Text(), QKey\-Event::key(), QLine\-Edit::return\-Pressed(), QKey\-Event::state(), and QEvent::type().\index{KLineEdit@{KLine\-Edit}!completionBox@{completionBox}}
\index{completionBox@{completionBox}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KCompletion\-Box} $\ast$ KLine\-Edit::completion\-Box (bool {\em create} = true)}\label{classKLineEdit_a13}


\begin{Desc}
\item[Returns:]the completion-box, that is used in completion mode {\bf KGlobal\-Settings::Completion\-Popup}. This method will create a completion-box 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 835 of file klineedit.cpp.

References KStd\-Action::create().\index{KLineEdit@{KLine\-Edit}!setCompletionObject@{setCompletionObject}}
\index{setCompletionObject@{setCompletionObject}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::set\-Completion\-Object ({\bf KCompletion} $\ast$, bool {\em hsig} = true)\hspace{0.3cm}{\tt  [virtual]}}\label{classKLineEdit_a14}


Reimplemented for internal reasons, the API is not affected. 



Reimplemented from {\bf KCompletion\-Base}.

Definition at line 843 of file klineedit.cpp.

References KCompletion\-Base::comp\-Obj(), KCompletion\-Base::handle\-Signals(), set\-Completed\-Items(), and KCompletion\-Base::set\-Completion\-Object().\index{KLineEdit@{KLine\-Edit}!copy@{copy}}
\index{copy@{copy}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::copy () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKLineEdit_a15}


Reimplemented for internal reasons, the API is not affected. 



Reimplemented from {\bf QLine\-Edit}.

Definition at line 226 of file klineedit.cpp.

References QApplication::clipboard(), QLine\-Edit::copy(), KStd\-Accel::end(), QLine\-Edit::end(), QString::mid(), and QLine\-Edit::selection\-Changed().

Referenced by key\-Press\-Event().\index{KLineEdit@{KLine\-Edit}!completionBoxActivated@{completionBoxActivated}}
\index{completionBoxActivated@{completionBoxActivated}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::completion\-Box\-Activated (const {\bf QString} \&)\hspace{0.3cm}{\tt  [signal]}}\label{classKLineEdit_l0}


Emitted whenever the completion box is activated. 

\begin{Desc}
\item[Since:]3.1 \end{Desc}
\index{KLineEdit@{KLine\-Edit}!returnPressed@{returnPressed}}
\index{returnPressed@{returnPressed}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::return\-Pressed (const {\bf QString} \&)\hspace{0.3cm}{\tt  [signal]}}\label{classKLineEdit_l1}


Emitted when the user presses the return key. 

The argument is the current text. Note that this signal is {\em not\/} emitted if the widget's {\tt Echo\-Mode} is set to QLine\-Edit::Echo\-Mode. \index{KLineEdit@{KLine\-Edit}!completion@{completion}}
\index{completion@{completion}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::completion (const {\bf QString} \&)\hspace{0.3cm}{\tt  [signal]}}\label{classKLineEdit_l2}


Emitted when the completion key is pressed. 

Please note that this signal is {\em not\/} emitted if the completion mode is set to {\tt Completion\-None} or {\tt Echo\-Mode} is {\em normal\/}. 

Referenced by key\-Press\-Event().\index{KLineEdit@{KLine\-Edit}!substringCompletion@{substringCompletion}}
\index{substringCompletion@{substringCompletion}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::substring\-Completion (const {\bf QString} \&)\hspace{0.3cm}{\tt  [signal]}}\label{classKLineEdit_l3}


Emitted when the shortcut for substring completion is pressed. 



Referenced by key\-Press\-Event().\index{KLineEdit@{KLine\-Edit}!textRotation@{textRotation}}
\index{textRotation@{textRotation}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::text\-Rotation ({\bf KCompletion\-Base::Key\-Binding\-Type})\hspace{0.3cm}{\tt  [signal]}}\label{classKLineEdit_l4}


Emitted when the text rotation key-bindings are pressed. 

The argument indicates which key-binding was pressed. In KLine\-Edit's case this can be either one of two values: {\bf Prev\-Completion\-Match} or {\bf Next\-Completion\-Match}. See {\bf KCompletion\-Base::set\-Key\-Binding} for details.

Note that this signal is {\em not\/} emitted if the completion mode is set to {\tt {\bf KGlobal\-Settings::Completion\-None}} or {\tt {\bf echo\-Mode()}} is {\em not\/} normal. 

Referenced by key\-Press\-Event().\index{KLineEdit@{KLine\-Edit}!completionModeChanged@{completionModeChanged}}
\index{completionModeChanged@{completionModeChanged}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::completion\-Mode\-Changed ({\bf KGlobal\-Settings::Completion})\hspace{0.3cm}{\tt  [signal]}}\label{classKLineEdit_l5}


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

\index{KLineEdit@{KLine\-Edit}!aboutToShowContextMenu@{aboutToShowContextMenu}}
\index{aboutToShowContextMenu@{aboutToShowContextMenu}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::about\-To\-Show\-Context\-Menu ({\bf QPopup\-Menu} $\ast$)\hspace{0.3cm}{\tt  [signal]}}\label{classKLineEdit_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}


Referenced by create\-Popup\-Menu().\index{KLineEdit@{KLine\-Edit}!setReadOnly@{setReadOnly}}
\index{setReadOnly@{setReadOnly}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::set\-Read\-Only (bool)\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKLineEdit_i0}


Re-implemented for internal reasons. 

API not changed. 

Reimplemented from {\bf QLine\-Edit}.

Definition at line 183 of file klineedit.cpp.

References QLine\-Edit::is\-Read\-Only(), QLine\-Edit::set\-Read\-Only(), and QLine\-Edit::set\-Text().\index{KLineEdit@{KLine\-Edit}!rotateText@{rotateText}}
\index{rotateText@{rotateText}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::rotate\-Text ({\bf KCompletion\-Base::Key\-Binding\-Type})\hspace{0.3cm}{\tt  [slot]}}\label{classKLineEdit_i1}


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

This function simply iterates over all possible matches in case multimple matches are found as a result of a text completion request. It will have no effect if only a single match is found.

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


Definition at line 137 of file klineedit.cpp.

References KCompletion\-Base::comp\-Obj(), QLine\-Edit::display\-Text(), QLine\-Edit::has\-Selected\-Text(), QString::is\-Null(), KCompletion\-Base::Next\-Completion\-Match, KCompletion::next\-Match(), KCompletion\-Base::Prev\-Completion\-Match, KCompletion::previous\-Match(), and set\-Completed\-Text().

Referenced by key\-Press\-Event().\index{KLineEdit@{KLine\-Edit}!setCompletedText@{setCompletedText}}
\index{setCompletedText@{setCompletedText}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::set\-Completed\-Text (const {\bf QString} \&)\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKLineEdit_i2}


See {\bf KCompletion\-Base::set\-Completed\-Text}. 



Implements {\bf KCompletion\-Base}.

Definition at line 128 of file klineedit.cpp.

References KGlobal\-Settings::Completion, KGlobal\-Settings::Completion\-Auto, KGlobal\-Settings::Completion\-Man, KCompletion\-Base::completion\-Mode(), and KGlobal\-Settings::Completion\-Popup.

Referenced by make\-Completion(), and rotate\-Text().\index{KLineEdit@{KLine\-Edit}!setCompletedItems@{setCompletedItems}}
\index{setCompletedItems@{setCompletedItems}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::set\-Completed\-Items (const {\bf QString\-List} \& {\em items})\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKLineEdit_i3}


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 814 of file klineedit.cpp.

References QString::is\-Empty(), and QLine\-Edit::text().

Referenced by key\-Press\-Event(), make\-Completion(), and set\-Completion\-Object().\index{KLineEdit@{KLine\-Edit}!clear@{clear}}
\index{clear@{clear}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::clear ()\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKLineEdit_i4}


Reimplemented to workaround a buggy {\bf QLine\-Edit::clear()} (changing the clipboard to the text we just had in the lineedit). 



Reimplemented from {\bf QLine\-Edit}.

Definition at line 864 of file klineedit.cpp.

References QLine\-Edit::set\-Text().

Referenced by KEdit\-List\-Box::clear().\index{KLineEdit@{KLine\-Edit}!setSqueezedText@{setSqueezedText}}
\index{setSqueezedText@{setSqueezedText}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::set\-Squeezed\-Text (const {\bf QString} \& {\em text})\hspace{0.3cm}{\tt  [slot]}}\label{classKLineEdit_i5}


Squeezes {\tt text} into the line edit. 

This can only be used with read-only line-edits. \begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 207 of file klineedit.cpp.

References QLine\-Edit::is\-Read\-Only(), resize\-Event(), and QLine\-Edit::set\-Text().\index{KLineEdit@{KLine\-Edit}!makeCompletion@{makeCompletion}}
\index{makeCompletion@{makeCompletion}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::make\-Completion (const {\bf QString} \&)\hspace{0.3cm}{\tt  [protected, virtual, slot]}}\label{classKLineEdit_j0}


Completes the remaining text with a matching one from a given list. 



Definition at line 152 of file klineedit.cpp.

References KCompletion::all\-Matches(), KGlobal\-Settings::Completion, KCompletion\-Base::completion\-Mode(), KGlobal\-Settings::Completion\-Popup, KCompletion\-Base::comp\-Obj(), QString::is\-Null(), KCompletion::make\-Completion(), set\-Completed\-Items(), and set\-Completed\-Text().

Referenced by key\-Press\-Event().\index{KLineEdit@{KLine\-Edit}!slotAboutToShow@{slotAboutToShow}}
\index{slotAboutToShow@{slotAboutToShow}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::slot\-About\-To\-Show ()\hspace{0.3cm}{\tt  [inline, protected, slot]}}\label{classKLineEdit_j1}


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

Will be removed in the next major release! 

Definition at line 397 of file klineedit.h.\index{KLineEdit@{KLine\-Edit}!slotCancelled@{slotCancelled}}
\index{slotCancelled@{slotCancelled}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::slot\-Cancelled ()\hspace{0.3cm}{\tt  [inline, protected, slot]}}\label{classKLineEdit_j2}


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

Will be removed in the next major release! 

Definition at line 402 of file klineedit.h.\index{KLineEdit@{KLine\-Edit}!resizeEvent@{resizeEvent}}
\index{resizeEvent@{resizeEvent}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::resize\-Event ({\bf QResize\-Event} $\ast$)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKLineEdit_b0}


Re-implemented for internal reasons. 

API not affected.

See QLine\-Edit::resize\-Event(). 

Definition at line 257 of file klineedit.cpp.

References QTool\-Tip::add(), QTool\-Tip::hide(), QString::left(), QString::length(), QTool\-Tip::remove(), QString::right(), QLine\-Edit::set\-Cursor\-Position(), QLine\-Edit::set\-Text(), and QFont\-Metrics::width().

Referenced by set\-Squeezed\-Text().\index{KLineEdit@{KLine\-Edit}!keyPressEvent@{keyPressEvent}}
\index{keyPressEvent@{keyPressEvent}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::key\-Press\-Event ({\bf QKey\-Event} $\ast$)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKLineEdit_b1}


Re-implemented for internal reasons. 

API not affected.

See {\bf QLine\-Edit::key\-Press\-Event}(). 

Reimplemented from {\bf QLine\-Edit}.

Reimplemented in {\bf KList\-View\-Line\-Edit} {\rm (p.\,\pageref{classKListViewLineEdit_b1})}, and {\bf KRestricted\-Line} {\rm (p.\,\pageref{classKRestrictedLine_b0})}.

Definition at line 320 of file klineedit.cpp.

References QKey\-Event::accept(), QApplication::clipboard(), completion(), KGlobal\-Settings::Completion, KGlobal\-Settings::Completion\-Auto, KGlobal\-Settings::Completion\-Man, KCompletion\-Base::completion\-Mode(), KGlobal\-Settings::Completion\-None, KGlobal\-Settings::Completion\-Popup, KGlobal\-Settings::Completion\-Shell, KCompletion\-Base::comp\-Obj(), copy(), KStd\-Accel::copy(), QLine\-Edit::cursor\-Position(), QLine\-Edit::cursor\-Word\-Backward(), QLine\-Edit::cursor\-Word\-Forward(), KStd\-Accel::cut(), QLine\-Edit::cut(), QLine\-Edit::del(), KStd\-Accel::delete\-Word\-Back(), KStd\-Accel::delete\-Word\-Forward(), QLine\-Edit::deselect(), QLine\-Edit::echo\-Mode(), KCompletion\-Base::emit\-Signals(), KCompletion\-Base::get\-Key\-Bindings(), KCompletion\-Base::handle\-Signals(), QLine\-Edit::has\-Selected\-Text(), QLine\-Edit::insert(), QString::is\-Empty(), QKey\-Event::key(), KStd\-Accel::key(), KCompletion\-Base::Key\-Binding\-Map, QLine\-Edit::key\-Press\-Event(), QString::length(), make\-Completion(), KCompletion\-Base::Next\-Completion\-Match, QLine\-Edit::paste(), KStd\-Accel::paste(), KCompletion\-Base::Prev\-Completion\-Match, QLine\-Edit::redo(), KStd\-Accel::redo(), rotate\-Text(), set\-Completed\-Items(), KStd\-Accel::shortcut(), QKey\-Event::state(), substring\-Completion(), KCompletion\-Base::Substring\-Completion, QLine\-Edit::text(), QKey\-Event::text(), KCompletion\-Base::Text\-Completion, text\-Rotation(), QLine\-Edit::undo(), KStd\-Accel::undo(), and QString::unicode().

Referenced by KList\-View\-Line\-Edit::key\-Press\-Event().\index{KLineEdit@{KLine\-Edit}!mousePressEvent@{mousePressEvent}}
\index{mousePressEvent@{mousePressEvent}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::mouse\-Press\-Event ({\bf QMouse\-Event} $\ast$)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKLineEdit_b2}


Re-implemented for internal reasons. 

API not affected.

See QLine\-Edit::mouse\-Press\-Event(). 

Definition at line 546 of file klineedit.cpp.

References QMouse\-Event::button(), and QLine\-Edit::select\-All().\index{KLineEdit@{KLine\-Edit}!mouseDoubleClickEvent@{mouseDoubleClickEvent}}
\index{mouseDoubleClickEvent@{mouseDoubleClickEvent}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::mouse\-Double\-Click\-Event ({\bf QMouse\-Event} $\ast$)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKLineEdit_b3}


Re-implemented for internal reasons. 

API not affected.

See {\bf QWidget::mouse\-Double\-Click\-Event}(). 

Definition at line 535 of file klineedit.cpp.

References QMouse\-Event::button(), QApplication::double\-Click\-Interval(), and QTimer::single\-Shot().\index{KLineEdit@{KLine\-Edit}!createPopupMenu@{createPopupMenu}}
\index{createPopupMenu@{createPopupMenu}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QPopup\-Menu} $\ast$ KLine\-Edit::create\-Popup\-Menu ()\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKLineEdit_b4}


Re-implemented for internal reasons. 

API not affected.

See {\bf QLine\-Edit::create\-Popup\-Menu}(). 

Reimplemented from {\bf QLine\-Edit}.

Definition at line 561 of file klineedit.cpp.

References about\-To\-Show\-Context\-Menu(), KGlobal\-Settings::Completion, KGlobal\-Settings::Completion\-Auto, KGlobal\-Settings::Completion\-Man, KGlobal\-Settings::completion\-Mode(), KCompletion\-Base::completion\-Mode(), KGlobal\-Settings::Completion\-None, KGlobal\-Settings::Completion\-Popup, KGlobal\-Settings::Completion\-Shell, KCompletion\-Base::comp\-Obj(), QLine\-Edit::create\-Popup\-Menu(), QPopup\-Menu::insert\-Item(), QPopup\-Menu::insert\-Separator(), QLine\-Edit::is\-Read\-Only(), QPopup\-Menu::set\-Accel(), and QPopup\-Menu::set\-Item\-Checked().\index{KLineEdit@{KLine\-Edit}!dropEvent@{dropEvent}}
\index{dropEvent@{dropEvent}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::drop\-Event ({\bf QDrop\-Event} $\ast$)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKLineEdit_b5}


Re-implemented to handle URI drops. 

See QLine\-Edit::drop\-Event(). 

Definition at line 653 of file klineedit.cpp.

References QDrop\-Event::accept(), QValue\-List$<$ KURL $>$::begin(), QValue\-List$<$ KURL $>$::Const\-Iterator(), KURLDrag::decode(), QValue\-List$<$ KURL $>$::end(), QString::is\-Empty(), QString::length(), and QLine\-Edit::text().\index{KLineEdit@{KLine\-Edit}!create@{create}}
\index{create@{create}!KLineEdit@{KLine\-Edit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KLine\-Edit::create (WId = 0, bool {\em initialize\-Window} = true, bool {\em destroy\-Old\-Window} = true)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKLineEdit_b7}


Reimplemented for internal reasons, the API is not affected. 



Definition at line 858 of file klineedit.cpp.

References KCursor::set\-Auto\-Hide\-Cursor().

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