28 #include <tqclipboard.h>
29 #include <tqpainter.h>
32 #include <tdeconfig.h>
33 #include <tqtooltip.h>
36 #include <tdestdaccel.h>
37 #include <tdepopupmenu.h>
39 #include <tdecompletionbox.h>
42 #include <kiconloader.h>
43 #include <tdeapplication.h>
45 #include "klineedit.h"
46 #include "klineedit.moc"
49 class KLineEdit::KLineEditPrivate
55 handleURLDrops =
true;
56 grabReturnKeyEvents =
false;
60 disableRestoreSelection =
false;
61 enableSqueezedText =
false;
66 backspacePerformsCompletion = config.readBoolEntry(
"Backspace performs completion",
false );
79 static bool initialized;
80 static bool backspacePerformsCompletion;
82 TQColor previousHighlightColor;
83 TQColor previousHighlightedTextColor;
85 bool userSelection: 1;
87 bool disableRestoreSelection: 1;
88 bool handleURLDrops:1;
89 bool grabReturnKeyEvents:1;
90 bool enableSqueezedText:1;
94 BackgroundMode bgMode;
95 TQString squeezedText;
102 bool KLineEdit::KLineEditPrivate::backspacePerformsCompletion =
false;
103 bool KLineEdit::KLineEditPrivate::initialized =
false;
107 :TQLineEdit( string, parent, name )
113 :TQLineEdit( parent, name )
124 void KLineEdit::init()
126 d =
new KLineEditPrivate;
127 possibleTripleClick =
false;
128 d->bgMode = backgroundMode ();
133 installEventFilter(
this );
139 connect(
this, TQT_SIGNAL(selectionChanged()),
this, TQT_SLOT(slotRestoreSelectionColors()));
141 TQPalette p = palette();
142 if ( !d->previousHighlightedTextColor.isValid() )
143 d->previousHighlightedTextColor=p.color(TQPalette::Normal,TQColorGroup::HighlightedText);
144 if ( !d->previousHighlightColor.isValid() )
145 d->previousHighlightColor=p.color(TQPalette::Normal,TQColorGroup::Highlight);
147 d->drawClickMsg =
false;
156 d->completionBox && d->completionBox->isVisible() )
157 d->completionBox->hide();
161 if ( echoMode() != TQLineEdit::Normal )
164 if ( kapp && !kapp->authorize(
"lineedit_text_completion") )
170 d->autoSuggest =
true;
172 d->autoSuggest =
false;
179 if ( !d->autoSuggest )
182 TQString txt = text();
186 int start = marked ? txt.length() : t.length();
187 validateAndSet( t, cursorPosition(), start, t.length() );
220 if ( input.isNull() || input == displayText() )
239 if ( match.isNull() )
241 if ( d->completionBox )
243 d->completionBox->hide();
244 d->completionBox->clear();
254 if ( match.isNull() || match == text )
260 if ( d->autoSuggest )
268 if (readOnly == isReadOnly ())
271 TQLineEdit::setReadOnly (readOnly);
275 d->bgMode = backgroundMode ();
276 setBackgroundMode (TQt::PaletteBackground);
277 if (d->enableSqueezedText && d->squeezedText.isEmpty())
279 d->squeezedText = text();
285 if (!d->squeezedText.isEmpty())
288 d->squeezedText = TQString::null;
290 setBackgroundMode (d->bgMode);
302 d->enableSqueezedText = enable;
307 return d->enableSqueezedText;
312 d->drawClickMsg = text.isEmpty() && !d->clickMessage.isEmpty();
315 if( d->enableSqueezedText && isReadOnly() )
317 d->squeezedText = text;
322 TQLineEdit::setText( text );
325 void KLineEdit::setSqueezedText()
327 d->squeezedStart = 0;
329 TQString fullText = d->squeezedText;
330 TQFontMetrics fm(fontMetrics());
331 int labelWidth = size().width() - 2*frameWidth() - 2;
332 int textWidth = fm.width(fullText);
334 if (textWidth > labelWidth)
337 TQString squeezedText =
"...";
338 int squeezedWidth = fm.width(squeezedText);
341 int letters = fullText.length() * (labelWidth - squeezedWidth) / textWidth / 2;
342 squeezedText = fullText.left(letters) +
"..." + fullText.right(letters);
343 squeezedWidth = fm.width(squeezedText);
345 if (squeezedWidth < labelWidth)
352 squeezedText = fullText.left(letters) +
"..." + fullText.right(letters);
353 squeezedWidth = fm.width(squeezedText);
354 }
while (squeezedWidth < labelWidth);
356 squeezedText = fullText.left(letters) +
"..." + fullText.right(letters);
358 else if (squeezedWidth > labelWidth)
365 squeezedText = fullText.left(letters) +
"..." + fullText.right(letters);
366 squeezedWidth = fm.width(squeezedText);
367 }
while (squeezedWidth > labelWidth);
373 TQLineEdit::setText(fullText);
377 TQLineEdit::setText(squeezedText);
378 d->squeezedStart = letters;
379 d->squeezedEnd = fullText.length() - letters;
382 TQToolTip::remove(
this );
383 TQToolTip::add(
this, fullText );
388 TQLineEdit::setText(fullText);
390 TQToolTip::remove(
this );
394 setCursorPosition(0);
399 if( !copySqueezedText(
true))
403 bool KLineEdit::copySqueezedText(
bool clipboard)
const
405 if (!d->squeezedText.isEmpty() && d->squeezedStart)
409 if (!that->getSelection(&start, &end))
411 if (start >= d->squeezedStart+3)
412 start = start - 3 - d->squeezedStart + d->squeezedEnd;
413 else if (start > d->squeezedStart)
414 start = d->squeezedStart;
415 if (end >= d->squeezedStart+3)
416 end = end - 3 - d->squeezedStart + d->squeezedEnd;
417 else if (end > d->squeezedStart)
418 end = d->squeezedEnd;
421 TQString t = d->squeezedText;
422 t = t.mid(start, end - start);
423 disconnect( TQApplication::clipboard(), TQT_SIGNAL(selectionChanged()),
this, 0);
424 TQApplication::clipboard()->setText( t, clipboard ? TQClipboard::Clipboard : TQClipboard::Selection );
425 connect( TQApplication::clipboard(), TQT_SIGNAL(selectionChanged()),
this,
426 TQT_SLOT(clipboardChanged()) );
434 if (!d->squeezedText.isEmpty())
437 TQLineEdit::resizeEvent(ev);
456 TQString text = TQApplication::clipboard()->text( TQClipboard::Selection);
479 cursorWordBackward(
true);
480 if ( hasSelectedText() )
489 cursorWordForward(
true);
490 if ( hasSelectedText() )
498 cursorWordBackward(
false);
504 cursorWordForward(
false);
524 if ( echoMode() == TQLineEdit::Normal &&
529 bool noModifier = (e->state() == Qt::NoButton ||
530 e->state() == TQt::ShiftButton ||
531 e->state() == TQt::Keypad);
537 if ( !d->userSelection && hasSelectedText() &&
538 ( e->key() == Key_Right || e->key() == Key_Left ) &&
539 e->state()== Qt::NoButton )
541 TQString old_txt = text();
542 d->disableRestoreSelection =
true;
544 getSelection(&start, &end);
547 TQLineEdit::keyPressEvent ( e );
548 int cPosition=cursorPosition();
549 if (e->key() ==Key_Right && cPosition > start )
550 validateAndSet(old_txt, cPosition, cPosition, old_txt.length());
552 validateAndSet(old_txt, cPosition, start, old_txt.length());
554 d->disableRestoreSelection =
false;
558 if ( e->key() == Key_Escape )
560 if (hasSelectedText() && !d->userSelection )
577 TQString keycode = e->text();
578 if ( !keycode.isEmpty() && (keycode.unicode()->isPrint() ||
579 e->key() == Key_Backspace || e->key() == Key_Delete ) )
581 bool hasUserSelection=d->userSelection;
582 bool hadSelection=hasSelectedText();
584 bool cursorNotAtEnd=
false;
587 getSelection(&start, &end);
588 int cPos = cursorPosition();
594 if ( hadSelection && !hasUserSelection && start>cPos )
597 setCursorPosition(cPos);
601 d->disableRestoreSelection =
true;
602 TQLineEdit::keyPressEvent ( e );
603 d->disableRestoreSelection =
false;
605 TQString txt = text();
606 int len = txt.length();
607 if ( !hasSelectedText() && len )
609 if ( e->key() == Key_Backspace )
611 if ( hadSelection && !hasUserSelection && !cursorNotAtEnd )
618 if ( !d->backspacePerformsCompletion || !len )
619 d->autoSuggest =
false;
622 if (e->key() == Key_Delete )
623 d->autoSuggest=
false;
631 if( (e->key() == Key_Backspace || e->key() == Key_Delete) )
644 noModifier && !e->text().isEmpty() )
646 TQString old_txt = text();
647 bool hasUserSelection=d->userSelection;
648 bool hadSelection=hasSelectedText();
649 bool cursorNotAtEnd=
false;
652 getSelection(&start, &end);
653 int cPos = cursorPosition();
654 TQString keycode = e->text();
660 if (hadSelection && !hasUserSelection && start>cPos &&
661 ( (!keycode.isEmpty() && keycode.unicode()->isPrint()) ||
662 e->key() == Key_Backspace || e->key() == Key_Delete ) )
665 setCursorPosition(cPos);
669 uint selectedLength=selectedText().length();
671 d->disableRestoreSelection =
true;
672 TQLineEdit::keyPressEvent ( e );
673 d->disableRestoreSelection =
false;
675 if (( selectedLength != selectedText().length() ) && !hasUserSelection )
676 slotRestoreSelectionColors();
678 TQString txt = text();
679 int len = txt.length();
681 if ( txt != old_txt && len &&
682 ( (!keycode.isEmpty() && keycode.unicode()->isPrint()) ||
683 e->key() == Key_Backspace || e->key() == Key_Delete) )
685 if ( e->key() == Key_Backspace )
687 if ( hadSelection && !hasUserSelection && !cursorNotAtEnd )
694 if ( !d->backspacePerformsCompletion )
695 d->autoSuggest =
false;
698 if (e->key() == Key_Delete )
699 d->autoSuggest=
false;
701 if ( d->completionBox )
702 d->completionBox->setCancelledText( txt );
711 if ( (e->key() == Key_Backspace || e->key() == Key_Delete ) &&
717 else if (!len && d->completionBox && d->completionBox->isVisible())
718 d->completionBox->hide();
736 TQString txt = text();
737 int len = txt.length();
738 if ( cursorPosition() == len && len != 0 )
747 else if ( d->completionBox )
748 d->completionBox->hide();
809 uint selectedLength = selectedText().length();
812 TQLineEdit::keyPressEvent ( e );
814 if ( selectedLength != selectedText().length() )
815 slotRestoreSelectionColors();
820 if ( e->button() == Qt::LeftButton )
822 possibleTripleClick=
true;
823 TQTimer::singleShot( TQApplication::doubleClickInterval(),
this,
824 TQT_SLOT(tripleClickTimeout()) );
826 TQLineEdit::mouseDoubleClickEvent( e );
831 if ( possibleTripleClick && e->button() == Qt::LeftButton )
837 TQLineEdit::mousePressEvent( e );
842 TQLineEdit::mouseReleaseEvent( e );
843 if (TQApplication::clipboard()->supportsSelection() ) {
844 if ( e->button() == Qt::LeftButton ) {
846 copySqueezedText(
false );
851 void KLineEdit::tripleClickTimeout()
853 possibleTripleClick=
false;
859 TQLineEdit::contextMenuEvent( e );
864 enum { IdUndo, IdRedo, IdSep1, IdCut, IdCopy, IdPaste, IdClear, IdSep2, IdSelectAll };
866 TQPopupMenu *popup = TQLineEdit::createPopupMenu();
868 int id = popup->idAt(0);
869 popup->changeItem(
id - IdUndo, SmallIconSet(
"edit-undo"), popup->text(
id - IdUndo) );
870 popup->changeItem(
id - IdRedo, SmallIconSet(
"edit-redo"), popup->text(
id - IdRedo) );
871 popup->changeItem(
id - IdCut, SmallIconSet(
"edit-cut"), popup->text(
id - IdCut) );
872 popup->changeItem(
id - IdCopy, SmallIconSet(
"edit-copy"), popup->text(
id - IdCopy) );
873 popup->changeItem(
id - IdPaste, SmallIconSet(
"edit-paste"), popup->text(
id - IdPaste) );
874 popup->changeItem(
id - IdClear, SmallIconSet(
"edit-clear"), popup->text(
id - IdClear) );
879 if (
compObj() && !isReadOnly() && kapp->authorize(
"lineedit_text_completion") )
881 TQPopupMenu *subMenu =
new TQPopupMenu( popup );
882 connect( subMenu, TQT_SIGNAL( activated(
int ) ),
883 this, TQT_SLOT( completionMenuActivated(
int ) ) );
885 popup->insertSeparator();
886 popup->insertItem( SmallIconSet(
"completion"), i18n(
"Text Completion"),
889 subMenu->insertItem( i18n(
"None"), NoCompletion );
890 subMenu->insertItem( i18n(
"Manual"), ShellCompletion );
891 subMenu->insertItem( i18n(
"Automatic"), AutoCompletion );
892 subMenu->insertItem( i18n(
"Dropdown List"), PopupCompletion );
893 subMenu->insertItem( i18n(
"Short Automatic"), ShortAutoCompletion );
894 subMenu->insertItem( i18n(
"Dropdown List && Automatic"), PopupAutoCompletion );
899 subMenu->setItemChecked( NoCompletion,
901 subMenu->setItemChecked( ShellCompletion,
903 subMenu->setItemChecked( PopupCompletion,
905 subMenu->setItemChecked( AutoCompletion,
907 subMenu->setItemChecked( ShortAutoCompletion,
909 subMenu->setItemChecked( PopupAutoCompletion,
913 subMenu->insertSeparator();
914 subMenu->insertItem( i18n(
"Default"), Default );
926 void KLineEdit::completionMenuActivated(
int id )
941 case ShortAutoCompletion:
944 case ShellCompletion:
947 case PopupCompletion:
950 case PopupAutoCompletion:
961 d->completionBox && d->completionBox->isVisible() )
962 d->completionBox->hide();
969 TQLineEdit::drawContents( p );
971 if ( d->drawClickMsg && !hasFocus() ) {
972 TQPen tmp = p->pen();
973 p->setPen( palette().color( TQPalette::Disabled, TQColorGroup::Text ) );
974 TQRect cr = contentsRect();
978 p->drawText( cr, AlignAuto | AlignVCenter, d->clickMessage );
985 d->drawClickMsg =
false;
989 TQString dropText = text();
990 KURL::List::ConstIterator it;
991 for( it = urlList.begin() ; it != urlList.end() ; ++it )
993 if(!dropText.isEmpty())
996 dropText += (*it).prettyURL();
999 validateAndSet( dropText, dropText.length(), 0, 0);
1004 TQLineEdit::dropEvent(e);
1009 if( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(
this) )
1012 if ( ev->type() == TQEvent::AccelOverride )
1014 TQKeyEvent *e = TQT_TQKEYEVENT( ev );
1015 if (overrideAccel (e))
1021 else if( ev->type() == TQEvent::KeyPress )
1023 TQKeyEvent *e = TQT_TQKEYEVENT( ev );
1025 if( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter )
1027 bool trap = d->completionBox && d->completionBox->isVisible();
1029 bool stopEvent = trap || (d->grabReturnKeyEvents &&
1030 (e->state() == Qt::NoButton ||
1031 e->state() == TQt::Keypad));
1036 emit TQLineEdit::returnPressed();
1044 d->completionBox->hide();
1046 setCursorPosition(text().length());
1054 return TQLineEdit::eventFilter( o, ev );
1060 d->handleURLDrops=enable;
1065 return d->handleURLDrops;
1070 d->grabReturnKeyEvents = grab;
1075 return d->grabReturnKeyEvents;
1085 if ( d->completionBox )
1088 d->completionBox = box;
1091 connect( d->completionBox, TQT_SIGNAL(highlighted(
const TQString& )),
1092 TQT_SLOT(setTextWorkaround(
const TQString& )) );
1093 connect( d->completionBox, TQT_SIGNAL(
userCancelled(
const TQString& )),
1097 connect( d->completionBox, TQT_SIGNAL( activated(
const TQString& )),
1109 else if (hasSelectedText() )
1111 if (d->userSelection)
1115 d->autoSuggest=
false;
1117 getSelection(&start, &end);
1118 TQString s=text().remove(start, end-start+1);
1119 validateAndSet(s,start,s.length(),s.length());
1120 d->autoSuggest=
true;
1125 bool KLineEdit::overrideAccel (
const TQKeyEvent* e)
1180 if (d->completionBox && d->completionBox->isVisible ())
1183 ButtonState state = e->state();
1184 if ((key == Key_Backtab || key == Key_Tab) &&
1185 (state == Qt::NoButton || (state & TQt::ShiftButton)))
1203 if ( d->completionBox && d->completionBox->isVisible() ) {
1211 if ( !items.isEmpty() &&
1212 !(items.count() == 1 && txt == items.first()) )
1217 if ( d->completionBox->isVisible() )
1219 bool wasSelected = d->completionBox->isSelected( d->completionBox->currentItem() );
1220 const TQString currentSelection = d->completionBox->currentText();
1221 d->completionBox->setItems( items );
1222 TQListBoxItem* item = d->completionBox->findItem( currentSelection, TQt::ExactMatch );
1226 if( !item || !wasSelected )
1228 wasSelected =
false;
1229 item = d->completionBox->item( 0 );
1233 d->completionBox->blockSignals(
true );
1234 d->completionBox->setCurrentItem( item );
1235 d->completionBox->setSelected( item, wasSelected );
1236 d->completionBox->blockSignals(
false );
1241 if ( !txt.isEmpty() )
1242 d->completionBox->setCancelledText( txt );
1243 d->completionBox->setItems( items );
1244 d->completionBox->popup();
1247 if ( d->autoSuggest && autoSuggest )
1249 int index = items.first().find( txt );
1250 TQString newText = items.first().mid( index );
1257 if ( d->completionBox && d->completionBox->isVisible() )
1258 d->completionBox->hide();
1264 if ( create && !d->completionBox ) {
1266 d->completionBox->setFont(font());
1269 return d->completionBox;
1276 disconnect( oldComp, TQT_SIGNAL( matches(
const TQStringList& )),
1280 connect( comp, TQT_SIGNAL( matches(
const TQStringList& )),
1289 TQLineEdit::create(
id, initializeWindow, destroyOldWindow );
1295 TQPalette p = palette();
1299 p.setColor(TQColorGroup::Highlight, d->previousHighlightColor);
1300 p.setColor(TQColorGroup::HighlightedText, d->previousHighlightedTextColor);
1304 TQColor color=p.color(TQPalette::Disabled, TQColorGroup::Text);
1305 p.setColor(TQColorGroup::HighlightedText, color);
1306 color=p.color(TQPalette::Active, TQColorGroup::Base);
1307 p.setColor(TQColorGroup::Highlight, color);
1310 d->userSelection=userSelection;
1314 void KLineEdit::slotRestoreSelectionColors()
1316 if (d->disableRestoreSelection)
1327 void KLineEdit::setTextWorkaround(
const TQString& text )
1335 if ( d->enableSqueezedText && isReadOnly() )
1336 return d->squeezedText;
1343 if ( d->drawClickMsg ) {
1344 d->drawClickMsg =
false;
1349 if ( ev->reason() == TQFocusEvent::Tab && inputMask().isNull() && hasSelectedText() )
1352 TQLineEdit::focusInEvent(ev);
1357 if ( text().isEmpty() && !d->clickMessage.isEmpty() ) {
1358 d->drawClickMsg =
true;
1361 TQLineEdit::focusOutEvent( ev );
1366 return d->autoSuggest;
1371 d->clickMessage = msg;
1377 return d->clickMessage;
1381 void KLineEdit::virtual_hook(
int id,
void* data )
1382 { TDECompletionBase::virtual_hook(
id, data ); }
virtual TQString makeCompletion(const TQString &string)
const TDEShortcut & undo()
virtual void keyPressEvent(TQKeyEvent *)
Re-implemented for internal reasons.
TQString clickMessage() const
bool handleSignals() const
KLineEdit(const TQString &string, TQWidget *parent, const char *name=0)
Constructs a KLineEdit object with a default text, a parent, and a name.
virtual void focusOutEvent(TQFocusEvent *)
Re-implemented for internal reasons.
void textRotation(TDECompletionBase::KeyBindingType)
Emitted when the text rotation key-bindings are pressed.
virtual void mouseReleaseEvent(TQMouseEvent *)
Re-implemented for internal reasons.
const TDEShortcut & deleteWordForward()
void completion(const TQString &)
Emitted when the completion key is pressed.
const TDEShortcut & beginningOfLine()
virtual void create(WId=0, bool initializeWindow=true, bool destroyOldWindow=true)
Reimplemented for internal reasons, the API is not affected.
virtual void drawContents(TQPainter *p)
Re-implemented for internal reasons.
TDEGlobalSettings::Completion completionMode() const
bool contains(const KKey &key) const
virtual void setCompletionObject(TDECompletion *compObj, bool hsig=true)
bool isSqueezedTextEnabled() const
Returns true if text squeezing is enabled.
bool trapReturnKey() const
virtual TQPopupMenu * createPopupMenu()
Re-implemented for internal reasons.
bool autoSuggest() const
Whether in current state text should be auto-suggested.
const TDEShortcut & shortcut(StdAccel id)
void setCompletedItems(const TQStringList &items)
Sets items into the completion-box if completionMode() is CompletionPopup.
void rotateText(TDECompletionBase::KeyBindingType type)
Iterates through all possible matches of the completed text or the history list.
const TDEShortcut & cut()
virtual void setCompletionMode(TDEGlobalSettings::Completion mode)
void setEnableSqueezedText(bool enable)
Enable text squeezing whenever the supplied text is too long.
void returnPressed(const TQString &)
Emitted when the user presses the return key.
virtual void clear()
Reimplemented to workaround a buggy TQLineEdit::clear() (changing the clipboard to the text we just h...
static void setAutoHideCursor(TQWidget *w, bool enable)
Sets auto-hiding the cursor for widget w.
const TDEShortcut & redo()
const TDEShortcut & backwardWord()
TQString originalText() const
Returns the original text if text squeezing is enabled.
virtual void makeCompletion(const TQString &)
Completes the remaining text with a matching one from a given list.
KeyBindingMap getKeyBindings() const
virtual void focusInEvent(TQFocusEvent *)
Re-implemented for internal reasons.
static Completion completionMode()
const TDEShortcut & pasteSelection()
void setUserSelection(bool userSelection)
Sets the widget in userSelection mode or in automatic completion selection mode.
virtual ~KLineEdit()
Destructor.
virtual void contextMenuEvent(TQContextMenuEvent *)
Re-implemented for internal reasons.
const TDEShortcut & deleteWordBack()
static bool decode(const TQMimeSource *e, KURL::List &urls)
virtual void setCompletedText(const TQString &)
See TDECompletionBase::setCompletedText.
void completionModeChanged(TDEGlobalSettings::Completion)
Emitted when the user changed the completion mode by using the popupmenu.
virtual void mousePressEvent(TQMouseEvent *)
Re-implemented for internal reasons.
void aboutToShowContextMenu(TQPopupMenu *p)
Emitted before the context menu is displayed.
void setTrapReturnKey(bool trap)
By default, KLineEdit recognizes Key_Return and Key_Enter and emits the returnPressed() signals...
virtual bool eventFilter(TQObject *, TQEvent *)
Re-implemented for internal reasons.
void substringCompletion(const TQString &)
Emitted when the shortcut for substring completion is pressed.
void setURLDropsEnabled(bool enable)
Enables/Disables handling of URL drops.
A helper widget for "completion-widgets" (KLineEdit, KComboBox))
virtual void setContextMenuEnabled(bool showMenu)
Enables/disables the popup (context) menu.
An enhanced TQLineEdit widget for inputting text.
void setClickMessage(const TQString &msg)
This makes the line edit display a grayed-out hinting text as long as the user didn't enter any text...
void setCompletionBox(TDECompletionBox *box)
Set the completion-box to be used in completion mode TDEGlobalSettings::CompletionPopup.
void completionBoxActivated(const TQString &)
Emitted whenever the completion box is activated.
TDECompletion * compObj() const
TDECompletionBox * completionBox(bool create=true)
virtual void dropEvent(TQDropEvent *)
Re-implemented to handle URI drops.
virtual void setCompletionObject(TDECompletion *, bool hsig=true)
Reimplemented for internal reasons, the API is not affected.
const TDEShortcut & copy()
virtual void copy() const
Reimplemented for internal reasons, the API is not affected.
void setURL(const KURL &url)
Sets url into the lineedit.
bool isURLDropsEnabled() const
Returns true when decoded URL drops are enabled.
const TDEShortcut & forwardWord()
void userCancelled(const TQString &cancelText)
Resets the current displayed text.
const TDEShortcut & paste()
TQString cancelledText() const
static TDEConfig * config()
virtual void resizeEvent(TQResizeEvent *)
Re-implemented for internal reasons.
static void autoHideEventFilter(TQObject *, TQEvent *)
KCursor has to install an eventFilter over the widget you want to auto-hide.
virtual void setReadOnly(bool)
Re-implemented for internal reasons.
virtual void setCompletionMode(TDEGlobalSettings::Completion mode)
Re-implemented from TDECompletionBase for internal reasons.
void setSqueezedText(const TQString &text)
Squeezes text into the line edit.
const TDEShortcut & completion()
TQStringList allMatches()
virtual void setText(const TQString &)
Re-implemented to enable text squeezing.
const TDEShortcut & endOfLine()
TQString prettyURL(int _trailing=0) const
virtual void mouseDoubleClickEvent(TQMouseEvent *)
Re-implemented for internal reasons.