• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | List of all members
TDECompletionBox Class Reference

#include <tdecompletionbox.h>

Inheritance diagram for TDECompletionBox:
TDEListBox

Public Slots

TQStringList items () const
 
void insertItems (const TQStringList &items, int index=-1)
 
void setItems (const TQStringList &items)
 
virtual void popup ()
 
void setTabHandling (bool enable)
 
bool isTabHandling () const
 
void setCancelledText (const TQString &txt)
 
TQString cancelledText () const
 
void setActivateOnSelect (bool state)
 
void down ()
 
void up ()
 
void pageDown ()
 
void pageUp ()
 
void home ()
 
void end ()
 
virtual void show ()
 
virtual void hide ()
 

Signals

void activated (const TQString &)
 
void userCancelled (const TQString &)
 
- Signals inherited from TDEListBox
void executed (TQListBoxItem *item)
 
void executed (TQListBoxItem *item, const TQPoint &pos)
 
void doubleClicked (TQListBoxItem *item, const TQPoint &pos)
 

Public Member Functions

 TDECompletionBox (TQWidget *parent, const char *name=0)
 
 ~TDECompletionBox ()
 
virtual TQSize sizeHint () const
 
bool activateOnSelect () const
 
- Public Member Functions inherited from TDEListBox
 TDEListBox (TQWidget *parent=0, const char *name=0, WFlags f=0)
 

Protected Slots

virtual void slotActivated (TQListBoxItem *)
 
- Protected Slots inherited from TDEListBox
void slotOnItem (TQListBoxItem *item)
 
void slotOnViewport ()
 
void slotSettingsChanged (int)
 
void slotAutoSelect ()
 

Protected Member Functions

TQRect calculateGeometry () const
 
void sizeAndPosition ()
 
virtual bool eventFilter (TQObject *, TQEvent *)
 
virtual void virtual_hook (int id, void *data)
 
- Protected Member Functions inherited from TDEListBox
void emitExecute (TQListBoxItem *item, const TQPoint &pos)
 
virtual void keyPressEvent (TQKeyEvent *e)
 
virtual void focusOutEvent (TQFocusEvent *fe)
 
virtual void leaveEvent (TQEvent *e)
 
virtual void contentsMousePressEvent (TQMouseEvent *e)
 
virtual void contentsMouseDoubleClickEvent (TQMouseEvent *e)
 
virtual void virtual_hook (int id, void *data)
 

Additional Inherited Members

- Protected Attributes inherited from TDEListBox
bool m_bUseSingle
 
bool m_bChangeCursorOverItem
 
TQListBoxItem * m_pCurrentItem
 
TQTimer * m_pAutoSelect
 
int m_autoSelectDelay
 

Detailed Description

A helper widget for "completion-widgets" (KLineEdit, KComboBox))

A little utility class for "completion-widgets", like KLineEdit or KComboBox. TDECompletionBox is a listbox, displayed as a rectangle without any window decoration, usually directly under the lineedit or combobox. It is filled with all possible matches for a completion, so the user can select the one he wants.

It is used when TDEGlobalSettings::Completion == CompletionPopup or CompletionPopupAuto.

Author
Carsten Pfeiffer pfeif.nosp@m.fer@.nosp@m.kde.o.nosp@m.rg

Definition at line 43 of file tdecompletionbox.h.

Constructor & Destructor Documentation

◆ TDECompletionBox()

TDECompletionBox::TDECompletionBox ( TQWidget *  parent,
const char *  name = 0 
)

Constructs a TDECompletionBox.

The parent widget is used to give the focus back when pressing the up-button on the very first item.

Definition at line 47 of file tdecompletionbox.cpp.

◆ ~TDECompletionBox()

TDECompletionBox::~TDECompletionBox ( )

Destroys the box.

Definition at line 79 of file tdecompletionbox.cpp.

Member Function Documentation

◆ activated

void TDECompletionBox::activated ( const TQString &  )
signal

Emitted when an item was selected, contains the text of the selected item.

◆ activateOnSelect()

bool TDECompletionBox::activateOnSelect ( ) const
Returns
true if selecting an item results in the emition of the selected signal.
Since
3.4.1

Definition at line 554 of file tdecompletionbox.cpp.

◆ calculateGeometry()

TQRect TDECompletionBox::calculateGeometry ( ) const
protected

This calculates the size of the dropdown and the relative position of the top left corner with respect to the parent widget.

This matches the geometry and position normally used by K/TQComboBox when used with one.

Definition at line 332 of file tdecompletionbox.cpp.

◆ cancelledText

TQString TDECompletionBox::cancelledText ( ) const
slot
Returns
the text set via setCancelledText() or TQString::null.

Definition at line 441 of file tdecompletionbox.cpp.

◆ down

void TDECompletionBox::down ( )
slot

Moves the selection one line down or select the first item if nothing is selected yet.

Definition at line 381 of file tdecompletionbox.cpp.

◆ end

void TDECompletionBox::end ( )
slot

Moves the selection down to the last item.

Definition at line 421 of file tdecompletionbox.cpp.

◆ eventFilter()

bool TDECompletionBox::eventFilter ( TQObject *  o,
TQEvent *  e 
)
protectedvirtual

Reimplemented from TDEListBox to get events from the viewport (to hide this widget on mouse-click, Escape-presses, etc.

Definition at line 108 of file tdecompletionbox.cpp.

◆ hide

void TDECompletionBox::hide ( )
virtualslot

Re-implemented for internal reasons.

API is unaffected.

Definition at line 324 of file tdecompletionbox.cpp.

◆ home

void TDECompletionBox::home ( )
slot

Moves the selection up to the first item.

Definition at line 416 of file tdecompletionbox.cpp.

◆ insertItems

void TDECompletionBox::insertItems ( const TQStringList &  items,
int  index = -1 
)
slot

Inserts items into the box.

Does not clear the items before. index determines at which position items will be inserted. (defaults to appending them at the end)

Definition at line 468 of file tdecompletionbox.cpp.

◆ isTabHandling

bool TDECompletionBox::isTabHandling ( ) const
slot
Returns
true if this widget is handling Tab-key events to traverse the items in the dropdown list, otherwise false.

Default is false.

See also
setTabHandling

Definition at line 431 of file tdecompletionbox.cpp.

◆ items

TQStringList TDECompletionBox::items ( ) const
slot

Returns a list of all items currently in the box.

Definition at line 85 of file tdecompletionbox.cpp.

◆ pageDown

void TDECompletionBox::pageDown ( )
slot

Moves the selection one page down.

Definition at line 402 of file tdecompletionbox.cpp.

◆ pageUp

void TDECompletionBox::pageUp ( )
slot

Moves the selection one page up.

Definition at line 409 of file tdecompletionbox.cpp.

◆ popup

void TDECompletionBox::popup ( )
virtualslot

Adjusts the size of the box to fit the width of the parent given in the constructor and pops it up at the most appropriate place, relative to the parent.

Depending on the screensize and the position of the parent, this may be a different place, however the default is to pop it up and the lower left corner of the parent.

Make sure to hide() the box when appropriate.

Definition at line 250 of file tdecompletionbox.cpp.

◆ setActivateOnSelect

void TDECompletionBox::setActivateOnSelect ( bool  state)
slot

Set whether or not the selected signal should be emitted when an item is selected.

By default the selected signal is emitted.

Parameters
statefalse if the signal should not be emitted.
Since
3.4.1

Definition at line 549 of file tdecompletionbox.cpp.

◆ setCancelledText

void TDECompletionBox::setCancelledText ( const TQString &  txt)
slot

Sets the text to be emitted if the user chooses not to pick from the available matches.

If the canceled text is not set through this function, the userCancelled signal will not be emitted.

See also
userCancelled( const TQString& )
Parameters
txtthe text to be emitted if the user cancels this box

Definition at line 436 of file tdecompletionbox.cpp.

◆ setItems

void TDECompletionBox::setItems ( const TQStringList &  items)
slot

Clears the box and inserts items.

Definition at line 477 of file tdecompletionbox.cpp.

◆ setTabHandling

void TDECompletionBox::setTabHandling ( bool  enable)
slot

Makes this widget (when visible) capture Tab-key events to traverse the items in the dropdown list.

Default off, as it conflicts with the usual behavior of Tab to traverse widgets. It is useful for cases like Konqueror's Location Bar, though.

See also
isTabHandling

Definition at line 426 of file tdecompletionbox.cpp.

◆ show

void TDECompletionBox::show ( void  )
virtualslot

Re-implemented for internal reasons.

API is unaffected.

Definition at line 300 of file tdecompletionbox.cpp.

◆ sizeAndPosition()

void TDECompletionBox::sizeAndPosition ( )
protected

This properly sizes and positions the listbox.

Definition at line 268 of file tdecompletionbox.cpp.

◆ sizeHint()

TQSize TDECompletionBox::sizeHint ( void  ) const
virtual

Definition at line 376 of file tdecompletionbox.cpp.

◆ slotActivated

void TDECompletionBox::slotActivated ( TQListBoxItem *  item)
protectedvirtualslot

Called when an item was activated.

Emits activated() with the item.

Definition at line 99 of file tdecompletionbox.cpp.

◆ up

void TDECompletionBox::up ( )
slot

Moves the selection one line up or select the first item if nothing is selected yet.

Definition at line 396 of file tdecompletionbox.cpp.

◆ userCancelled

void TDECompletionBox::userCancelled ( const TQString &  )
signal

Emitted whenever the user chooses to ignore the available selections and close the this box.

◆ virtual_hook()

void TDECompletionBox::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Reimplemented from TDEListBox.

Definition at line 559 of file tdecompletionbox.cpp.


The documentation for this class was generated from the following files:
  • tdecompletionbox.h
  • tdecompletionbox.cpp

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.9.4
This website is maintained by Timothy Pearson.