KDevelop API Documentation

QComboView Class Reference

#include <qcomboview.h>

Inheritance diagram for QComboView:

QWidget KComboView List of all members.

Public Types

enum  Policy {
  NoInsertion, AtTop, AtCurrent, AtBottom,
  AfterCurrent, BeforeCurrent
}

Public Slots

virtual void clear ()
void clearValidator ()
void clearEdit ()
virtual void setEditText (const QString &)

Signals

void activated (QListViewItem *item)
void highlighted (QListViewItem *item)
void activated (const QString &)
void highlighted (const QString &)
void textChanged (const QString &)
void focusGranted ()
void focusLost ()

Public Member Functions

 QComboView (bool rw, QWidget *parent=0, const char *name=0)
 ~QComboView ()
int childCount () const
QListViewItemcurrentItem () const
virtual void setCurrentItem (QListViewItem *)
virtual void setCurrentActiveItem (QListViewItem *)
bool autoResize () const
virtual void setAutoResize (bool)
QSize sizeHint () const
void setPalette (const QPalette &)
void setFont (const QFont &)
void setEnabled (bool)
virtual void setSizeLimit (int)
int sizeLimit () const
virtual void setInsertionPolicy (Policy policy)
Policy insertionPolicy () const
virtual void setValidator (const QValidator *)
const QValidatorvalidator () const
virtual void setListView (QListView *)
QListViewlistView () const
virtual void setLineEdit (QLineEdit *edit)
QLineEditlineEdit () const
virtual void setAutoCompletion (bool)
bool autoCompletion () const
bool eventFilter (QObject *object, QEvent *event)
void setDuplicatesEnabled (bool enable)
bool duplicatesEnabled () const
bool editable () const
void setEditable (bool)
virtual void popup ()
QString currentText () const
void setCurrentText (const QString &)

Protected Member Functions

void paintEvent (QPaintEvent *)
void resizeEvent (QResizeEvent *)
void mousePressEvent (QMouseEvent *)
void mouseMoveEvent (QMouseEvent *)
void mouseReleaseEvent (QMouseEvent *)
void mouseDoubleClickEvent (QMouseEvent *)
void keyPressEvent (QKeyEvent *e)
void focusInEvent (QFocusEvent *e)
void focusOutEvent (QFocusEvent *e)
void wheelEvent (QWheelEvent *e)
void styleChange (QStyle &)
void updateMask ()

Properties

bool editable
QString currentText
bool autoResize
int sizeLimit
Policy insertionPolicy
bool autoCompletion
bool duplicatesEnabled

Private Slots

void internalActivate (QListViewItem *)
void internalHighlight (QListViewItem *)
void internalClickTimeout ()
void returnPressed ()
void checkState (QListViewItem *)

Private Member Functions

void setUpListView ()
void setUpLineEdit ()
void popDownListView ()
void reIndex ()
void currentChanged ()
QListViewItemcompletionIndex (const QString &, QListViewItem *) const

Private Attributes

QComboViewDatad

Member Enumeration Documentation

enum QComboView::Policy
 

Enumeration values:
NoInsertion 
AtTop 
AtCurrent 
AtBottom 
AfterCurrent 
BeforeCurrent 

Definition at line 75 of file qcomboview.h.


Constructor & Destructor Documentation

QComboView::QComboView bool  rw,
QWidget parent = 0,
const char *  name = 0
 

Constructs a combobox with a maximum size and either Motif 2.0 or Windows look and feel.

The input field can be edited if rw is TRUE, otherwise the user may only choose one of the items in the combobox.

The parent and name arguments are passed on to the QWidget constructor.

Definition at line 141 of file qcomboview.cpp.

References QComboViewData::arrowDown, AtBottom, QComboViewData::autoresize, QComboViewData::completeAt, QComboViewData::completeNow, QComboViewData::completionTimer, QComboViewData::current, d, QComboViewData::discardNextMousePress, QComboViewData::ed, QComboViewData::maxCount, QComboViewData::p, QComboViewData::poppedUp, QComboView(), setSizeLimit(), setUpLineEdit(), setUpListView(), QComboViewData::shortClick, and QComboViewData::useCompletion.

Referenced by QComboView().

QComboView::~QComboView  ) 
 

Destroys the combobox.

Definition at line 175 of file qcomboview.cpp.

References d.


Member Function Documentation

void QComboView::activated const QString  )  [signal]
 

void QComboView::activated QListViewItem item  )  [signal]
 

Referenced by internalActivate(), keyPressEvent(), returnPressed(), setCurrentActiveItem(), and wheelEvent().

bool QComboView::autoCompletion  )  const
 

bool QComboView::autoResize  )  const
 

void QComboView::checkState QListViewItem  )  [private, slot]
 

Definition at line 1478 of file qcomboview.cpp.

References checkState().

Referenced by checkState(), setListView(), and setUpListView().

int QComboView::childCount  )  const
 

Definition at line 190 of file qcomboview.cpp.

References d, and QComboViewData::listView().

Referenced by keyPressEvent(), mousePressEvent(), popup(), and sizeHint().

void QComboView::clear void   )  [virtual, slot]
 

Removes all comboview items.

Reimplemented in KComboView.

Definition at line 200 of file qcomboview.cpp.

References QComboViewData::current, currentChanged(), d, QComboViewData::ed, QComboViewData::listView(), and QComboViewData::updateLinedGeometry().

Referenced by KComboView::clear(), and setListView().

void QComboView::clearEdit  )  [slot]
 

Clears the line edit without changing the combobox's contents. Does nothing if the combobox isn't editable.

This is particularly useful when using a combobox as a line edit with history. For example you can connect the combobox's activated() signal to clearEdit() in order to present the user with a new, empty line as soon as Enter is pressed.

See also:
setEditText()

Definition at line 1303 of file qcomboview.cpp.

References d, and QComboViewData::ed.

void QComboView::clearValidator  )  [slot]
 

This slot is equivalent to setValidator( 0 ).

Definition at line 1200 of file qcomboview.cpp.

References d, and QComboViewData::ed.

QListViewItem * QComboView::completionIndex const QString prefix,
QListViewItem startingAt
const [private]
 

Returns the index of the first item after startingAt of which prefix is a case-insensitive prefix. Returns -1 if no items start with prefix.

Definition at line 1015 of file qcomboview.cpp.

References completionIndex(), and listView().

Referenced by completionIndex(), eventFilter(), and keyPressEvent().

void QComboView::currentChanged  )  [private]
 

Definition at line 840 of file qcomboview.cpp.

References QComboViewData::autoresize, and d.

Referenced by clear(), setCurrentActiveItem(), setCurrentItem(), setListView(), and setUpListView().

QListViewItem * QComboView::currentItem  )  const
 

Definition at line 213 of file qcomboview.cpp.

References QComboViewData::current, and d.

Referenced by ClassViewPart::addFile(), eventFilter(), ClassViewPart::goToClassDeclaration(), ClassViewPart::goToFunctionDeclaration(), ClassViewPart::goToFunctionDefinition(), ClassViewPart::goToNamespaceDeclaration(), keyPressEvent(), ViewCombosOp::processClass(), ViewCombosOp::processNamespace(), ClassBrowserPart::refreshClasses(), ClassBrowserPart::refreshMethods(), KComboView::removeItem(), returnPressed(), ClassViewPart::selectedAddAttribute(), ClassViewPart::selectedAddMethod(), setCurrentText(), setEditable(), ClassViewPart::updateClassesForAdd(), ClassViewPart::updateFunctionsForAdd(), QComboViewData::updateLinedGeometry(), and wheelEvent().

QString QComboView::currentText  )  const
 

Referenced by keyPressEvent(), setEditable(), setLineEdit(), and wheelEvent().

bool QComboView::duplicatesEnabled  )  const
 

bool QComboView::editable  )  const
 

Referenced by mousePressEvent(), and setEditable().

bool QComboView::eventFilter QObject object,
QEvent event
 

reimp

Definition at line 858 of file qcomboview.cpp.

References QComboViewData::arrowDown, QComboViewData::arrowPressed, QComboViewData::completeAt, QComboViewData::completeNow, completionIndex(), currentItem(), d, QComboViewData::discardNextMousePress, QComboViewData::ed, eventFilter(), focusInEvent(), focusOutEvent(), keyPressEvent(), QComboViewData::listView(), QComboViewData::mouseWasInsidePopup, popDownListView(), QComboViewData::poppedUp, and QComboViewData::useCompletion.

Referenced by eventFilter().

void QComboView::focusGranted  )  [signal]
 

Referenced by focusInEvent().

void QComboView::focusInEvent QFocusEvent e  )  [protected]
 

reimp

Definition at line 613 of file qcomboview.cpp.

References QComboViewData::completeAt, QComboViewData::completeNow, d, focusGranted(), and focusInEvent().

Referenced by eventFilter(), and focusInEvent().

void QComboView::focusLost  )  [signal]
 

Referenced by focusOutEvent().

void QComboView::focusOutEvent QFocusEvent e  )  [protected]
 

reimp

Definition at line 625 of file qcomboview.cpp.

References QComboViewData::completeAt, QComboViewData::completeNow, d, focusLost(), and focusOutEvent().

Referenced by eventFilter(), and focusOutEvent().

void QComboView::highlighted const QString  )  [signal]
 

void QComboView::highlighted QListViewItem item  )  [signal]
 

Referenced by internalHighlight().

Policy QComboView::insertionPolicy  )  const
 

Referenced by returnPressed().

void QComboView::internalActivate QListViewItem item  )  [private, slot]
 

Definition at line 306 of file qcomboview.cpp.

References activated(), QComboViewData::current, d, QComboViewData::ed, internalActivate(), popDownListView(), QComboViewData::poppedUp, and QComboViewData::updateLinedGeometry().

Referenced by internalActivate(), setCurrentActiveItem(), setListView(), and setUpListView().

void QComboView::internalClickTimeout  )  [private, slot]
 

Definition at line 362 of file qcomboview.cpp.

References d, and QComboViewData::shortClick.

Referenced by mousePressEvent().

void QComboView::internalHighlight QListViewItem item  )  [private, slot]
 

Definition at line 340 of file qcomboview.cpp.

References QComboViewData::current, d, QComboViewData::ed, highlighted(), internalHighlight(), and QComboViewData::updateLinedGeometry().

Referenced by internalHighlight(), setCurrentActiveItem(), setCurrentItem(), setListView(), and setUpListView().

void QComboView::keyPressEvent QKeyEvent e  )  [protected]
 

reimp

Definition at line 525 of file qcomboview.cpp.

References activated(), childCount(), QComboViewData::completeAt, completionIndex(), QComboViewData::completionTimer, currentItem(), currentText(), d, QComboViewData::ed, keyPressEvent(), listView(), popup(), and setCurrentItem().

Referenced by eventFilter(), and keyPressEvent().

QLineEdit * QComboView::lineEdit  )  const
 

Returns the line edit, or 0 if there is no line edit.

Only editable listboxes have a line editor.

Definition at line 1284 of file qcomboview.cpp.

References d, and QComboViewData::ed.

QListView * QComboView::listView  )  const
 

Returns the current list box, or 0 if there is no list box. (QComboView can use QPopupMenu instead of QListBox.) Provided to match setlistView().

See also:
setlistView()

Definition at line 1274 of file qcomboview.cpp.

References d, and QComboViewData::listView().

Referenced by ClassViewPart::addFile(), completionIndex(), keyPressEvent(), mousePressEvent(), ClassBrowserPart::refresh(), ViewCombosOp::refreshClasses(), ClassBrowserPart::refreshClasses(), ViewCombosOp::refreshFunctions(), ClassBrowserPart::refreshMethods(), ViewCombosOp::refreshNamespaces(), ClassViewPart::removeFile(), returnPressed(), setCurrentText(), ClassViewPart::syncCombos(), ClassViewPart::updateClassesForAdd(), and ClassViewPart::updateFunctionsForAdd().

void QComboView::mouseDoubleClickEvent QMouseEvent e  )  [protected]
 

reimp

Definition at line 516 of file qcomboview.cpp.

References mouseDoubleClickEvent(), and mousePressEvent().

Referenced by mouseDoubleClickEvent().

void QComboView::mouseMoveEvent QMouseEvent  )  [protected]
 

reimp

Definition at line 502 of file qcomboview.cpp.

References mouseMoveEvent().

Referenced by mouseMoveEvent().

void QComboView::mousePressEvent QMouseEvent e  )  [protected]
 

reimp

Definition at line 467 of file qcomboview.cpp.

References QComboViewData::arrowDown, QComboViewData::arrowPressed, childCount(), d, QComboViewData::discardNextMousePress, editable(), internalClickTimeout(), listView(), mousePressEvent(), popup(), and QComboViewData::shortClick.

Referenced by mouseDoubleClickEvent(), and mousePressEvent().

void QComboView::mouseReleaseEvent QMouseEvent  )  [protected]
 

reimp

Definition at line 509 of file qcomboview.cpp.

References mouseReleaseEvent().

Referenced by mouseReleaseEvent().

void QComboView::paintEvent QPaintEvent  )  [protected]
 

reimp

Definition at line 412 of file qcomboview.cpp.

References QComboViewData::arrowDown, QComboViewData::current, d, QComboViewData::ed, QComboViewData::listView(), paintEvent(), and QPainter::translate().

Referenced by paintEvent().

void QComboView::popDownListView  )  [private]
 

Definition at line 812 of file qcomboview.cpp.

References QComboViewData::arrowDown, QComboViewData::current, d, QComboViewData::listView(), and QComboViewData::poppedUp.

Referenced by eventFilter(), and internalActivate().

void QComboView::popup  )  [virtual]
 

Pops up the combobox popup list.

If the list is empty, no items appear.

Definition at line 719 of file qcomboview.cpp.

References childCount(), QComboViewData::current, d, listHeight(), QComboViewData::listView(), QComboViewData::mouseWasInsidePopup, QComboViewData::poppedUp, and QComboViewData::sizeLimit.

Referenced by keyPressEvent(), and mousePressEvent().

void QComboView::reIndex  )  [private]
 

Definition at line 831 of file qcomboview.cpp.

void QComboView::resizeEvent QResizeEvent e  )  [protected]
 

reimp

Definition at line 401 of file qcomboview.cpp.

References d, QComboViewData::ed, QComboViewData::listView(), resizeEvent(), and QComboViewData::updateLinedGeometry().

Referenced by resizeEvent().

void QComboView::returnPressed  )  [private, slot]
 

Internal slot to keep the line editor up to date.

Definition at line 1087 of file qcomboview.cpp.

References activated(), AfterCurrent, AtBottom, AtCurrent, AtTop, BeforeCurrent, currentItem(), d, QComboViewData::duplicatesEnabled, QComboViewData::ed, insertionPolicy(), listView(), NoInsertion, s, and setCurrentItem().

Referenced by setLineEdit(), setListView(), and setUpListView().

void QComboView::setAutoCompletion bool   )  [virtual]
 

Definition at line 1329 of file qcomboview.cpp.

References QComboViewData::completeNow, d, setAutoCompletion(), and QComboViewData::useCompletion.

Referenced by setAutoCompletion().

void QComboView::setAutoResize bool   )  [virtual]
 

Definition at line 258 of file qcomboview.cpp.

References QComboViewData::autoresize, d, and setAutoResize().

Referenced by setAutoResize().

void QComboView::setCurrentActiveItem QListViewItem  )  [virtual]
 

Definition at line 1483 of file qcomboview.cpp.

References activated(), QComboViewData::completeAt, QComboViewData::current, currentChanged(), d, QComboViewData::ed, internalActivate(), internalHighlight(), QComboViewData::listView(), setCurrentActiveItem(), and QComboViewData::updateLinedGeometry().

Referenced by ViewCombosOp::refreshNamespaces(), ClassViewPart::removeFile(), ClassViewPart::removeNamespace(), setCurrentActiveItem(), and ClassViewPart::syncCombos().

void QComboView::setCurrentItem QListViewItem  )  [virtual]
 

Definition at line 218 of file qcomboview.cpp.

References QComboViewData::completeAt, QComboViewData::current, currentChanged(), d, QComboViewData::ed, internalHighlight(), QComboViewData::listView(), setCurrentItem(), and QComboViewData::updateLinedGeometry().

Referenced by keyPressEvent(), returnPressed(), setCurrentItem(), setCurrentText(), ClassViewPart::syncCombos(), and wheelEvent().

void QComboView::setCurrentText const QString  ) 
 

Definition at line 1466 of file qcomboview.cpp.

References currentItem(), d, QComboViewData::ed, listView(), setCurrentItem(), and setCurrentText().

Referenced by ClassViewPart::addFile(), ClassViewPart::focusClasses(), ClassViewPart::focusFunctions(), ViewCombosOp::processClass(), ViewCombosOp::processNamespace(), ViewCombosOp::refreshClasses(), ViewCombosOp::refreshFunctions(), setCurrentText(), ClassViewPart::unfocusClasses(), ClassViewPart::unfocusFunctions(), ClassViewPart::updateClassesForAdd(), and ClassViewPart::updateFunctionsForAdd().

void QComboView::setDuplicatesEnabled bool  enable  ) 
 

Definition at line 180 of file qcomboview.cpp.

References d, QComboViewData::duplicatesEnabled, and setDuplicatesEnabled().

Referenced by KListViewAction::KListViewAction(), and setDuplicatesEnabled().

void QComboView::setEditable bool   ) 
 

Definition at line 1356 of file qcomboview.cpp.

References currentItem(), currentText(), d, QComboViewData::ed, editable(), setEditable(), setEditText(), setUpLineEdit(), and setUpListView().

Referenced by setEditable().

void QComboView::setEditText const QString newText  )  [virtual, slot]
 

Sets the text in the line edit to newText without changing the combobox's contents. Does nothing if the combobox isn't editable.

This is useful e.g. for providing a good starting point for the user's editing and entering the change in the combobox only when the user presses Enter.

See also:
clearEdit() insertItem()

Definition at line 1321 of file qcomboview.cpp.

References d, QComboViewData::ed, setEditText(), and QComboViewData::updateLinedGeometry().

Referenced by setEditable(), and setEditText().

void QComboView::setEnabled bool  enable  ) 
 

reimp

Definition at line 1160 of file qcomboview.cpp.

References setEnabled().

Referenced by setEnabled().

void QComboView::setFont const QFont font  ) 
 

Sets the font for both the combobox button and the combobox popup list to font.

Definition at line 386 of file qcomboview.cpp.

References QComboViewData::autoresize, d, QComboViewData::ed, QComboViewData::listView(), setFont(), and QComboViewData::sizeHint.

Referenced by setFont().

void QComboView::setInsertionPolicy Policy  policy  )  [virtual]
 

Definition at line 1076 of file qcomboview.cpp.

References d, QComboViewData::p, and setInsertionPolicy().

Referenced by KListViewAction::KListViewAction(), and setInsertionPolicy().

void QComboView::setLineEdit QLineEdit edit  )  [virtual]
 

Sets the line edit to use edit instead of the current line edit.

Definition at line 1421 of file qcomboview.cpp.

References currentText(), d, QComboViewData::ed, returnPressed(), setLineEdit(), setUpListView(), textChanged(), and QComboViewData::updateLinedGeometry().

Referenced by setLineEdit(), and setUpLineEdit().

void QComboView::setListView QListView newListView  )  [virtual]
 

Sets the combobox to use newListBox instead of the current list box or popup. As a side effect, it clears the combobox of its current contents.

Warning:
QComboView assumes that newListBox->text(n) returns non-null for 0 <= n < newListbox->count(). This assumption is necessary because of the line edit in QComboView.

Definition at line 1217 of file qcomboview.cpp.

References checkState(), clear(), QComboViewData::current, currentChanged(), d, internalActivate(), internalHighlight(), QComboViewData::listView(), returnPressed(), QComboViewData::setListView(), and setListView().

Referenced by setListView().

void QComboView::setPalette const QPalette palette  ) 
 

Sets the palette for both the combobox button and the combobox popup list to palette.

Definition at line 372 of file qcomboview.cpp.

References d, QComboViewData::listView(), and setPalette().

Referenced by setPalette().

void QComboView::setSizeLimit int   )  [virtual]
 

Definition at line 1052 of file qcomboview.cpp.

References d, setSizeLimit(), and QComboViewData::sizeLimit.

Referenced by QComboView(), and setSizeLimit().

void QComboView::setUpLineEdit  )  [private]
 

Definition at line 1411 of file qcomboview.cpp.

References d, QComboViewData::ed, and setLineEdit().

Referenced by QComboView(), and setEditable().

void QComboView::setUpListView  )  [private]
 

Definition at line 1377 of file qcomboview.cpp.

References checkState(), QComboViewData::current, currentChanged(), d, internalActivate(), internalHighlight(), QComboViewData::listView(), returnPressed(), and QComboViewData::setListView().

Referenced by QComboView(), setEditable(), and setLineEdit().

void QComboView::setValidator const QValidator v  )  [virtual]
 

Applies the validator v to the combobox so that only text which is valid according to v is accepted.

This function does nothing if the combobox is not editable.

See also:
validator() clearValidator() QValidator

Definition at line 1176 of file qcomboview.cpp.

References d, QComboViewData::ed, and setValidator().

Referenced by setValidator().

QSize QComboView::sizeHint void   )  const
 

reimp

This implementation caches the size hint to avoid resizing when the contents change dynamically. To invalidate the cached value call setFont().

Definition at line 275 of file qcomboview.cpp.

References childCount(), d, and QComboViewData::sizeHint.

int QComboView::sizeLimit  )  const
 

void QComboView::styleChange QStyle s  )  [protected]
 

reimp

Definition at line 1343 of file qcomboview.cpp.

References d, QComboViewData::ed, QComboViewData::sizeHint, styleChange(), and QComboViewData::updateLinedGeometry().

Referenced by styleChange().

void QComboView::textChanged const QString  )  [signal]
 

Referenced by setLineEdit().

void QComboView::updateMask  )  [protected]
 

reimp

Definition at line 795 of file qcomboview.cpp.

References size.

const QValidator * QComboView::validator  )  const
 

Returns the validator which constrains editing for this combobox if there is one; otherwise returns 0.

See also:
setValidator() clearValidator() QValidator

Definition at line 1190 of file qcomboview.cpp.

References d, and QComboViewData::ed.

void QComboView::wheelEvent QWheelEvent e  )  [protected]
 

reimp

Definition at line 637 of file qcomboview.cpp.

References activated(), currentItem(), currentText(), d, QComboViewData::listView(), QComboViewData::poppedUp, setCurrentItem(), and wheelEvent().

Referenced by wheelEvent().


Member Data Documentation

QComboViewData* QComboView::d [private]
 

Definition at line 151 of file qcomboview.h.

Referenced by childCount(), clear(), clearEdit(), clearValidator(), currentChanged(), currentItem(), eventFilter(), focusInEvent(), focusOutEvent(), internalActivate(), internalClickTimeout(), internalHighlight(), keyPressEvent(), lineEdit(), listView(), mousePressEvent(), paintEvent(), popDownListView(), popup(), QComboView(), resizeEvent(), returnPressed(), setAutoCompletion(), setAutoResize(), setCurrentActiveItem(), setCurrentItem(), setCurrentText(), setDuplicatesEnabled(), setEditable(), setEditText(), setFont(), setInsertionPolicy(), setLineEdit(), setListView(), setPalette(), setSizeLimit(), setUpLineEdit(), setUpListView(), setValidator(), sizeHint(), styleChange(), validator(), wheelEvent(), and ~QComboView().


Property Documentation

bool QComboView::autoCompletion [read, write]
 

Definition at line 46 of file qcomboview.h.

bool QComboView::autoResize [read, write]
 

Definition at line 42 of file qcomboview.h.

QString QComboView::currentText [read, write]
 

Definition at line 40 of file qcomboview.h.

Referenced by ClassViewPart::focusClasses(), ClassViewPart::focusFunctions(), ClassViewPart::unfocusClasses(), and ClassViewPart::unfocusFunctions().

bool QComboView::duplicatesEnabled [read, write]
 

Definition at line 47 of file qcomboview.h.

bool QComboView::editable [read, write]
 

Definition at line 38 of file qcomboview.h.

QComboView::Policy QComboView::insertionPolicy [read, write]
 

Definition at line 45 of file qcomboview.h.

int QComboView::sizeLimit [read, write]
 

Definition at line 43 of file qcomboview.h.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.0.4.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Oct 19 08:02:06 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003