Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OEditListBox Class Reference

#include </home/clem/local/src/opie/libopie2/qt3/opieui/oeditlistbox.h>

Collaboration diagram for OEditListBox:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Button { Add = 1, Remove = 2, UpDown = 4, All = Add|Remove|UpDown }

Signals

void changed ()
void added (const QString &text)
void removed (const QString &text)

Public Member Functions

 OEditListBox (QWidget *parent=0, const char *name=0, bool checkAtEntering=false, int buttons=All)
 OEditListBox (const QString &title, QWidget *parent=0, const char *name=0, bool checkAtEntering=false, int buttons=All)
 OEditListBox (const QString &title, const CustomEditor &customEditor, QWidget *parent=0, const char *name=0, bool checkAtEntering=false, int buttons=All)
virtual ~OEditListBox ()
QListBox * listBox () const
OLineEditlineEdit () const
QPushButton * addButton () const
QPushButton * removeButton () const
QPushButton * upButton () const
QPushButton * downButton () const
int count () const
void insertStringList (const QStringList &list, int index=-1)
void insertStrList (const QStrList *list, int index=-1)
void insertStrList (const QStrList &list, int index=-1)
void insertStrList (const char **list, int numStrings=-1, int index=-1)
void insertItem (const QString &text, int index=-1)
void clear ()
QString text (int index) const
int currentItem () const
QString currentText () const
QStringList items () const

Protected Slots

void moveItemUp ()
void moveItemDown ()
void addItem ()
void removeItem ()
void enableMoveButtons (int index)
void typedSomething (const QString &text)

Protected Member Functions

virtual void virtual_hook (int id, void *data)

Private Member Functions

void init (bool checkAtEntering, int buttons, QWidget *representationWidget=0L)

Private Attributes

QListBox * m_listBox
QPushButton * servUpButton
QPushButton * servDownButton
QPushButton * servNewButton
QPushButton * servRemoveButton
OLineEditm_lineEdit
OEditListBoxPrivated

Classes

class  CustomEditor

Detailed Description

An editable listbox

This class provides a editable listbox ;-), this means a listbox which is accompanied by a line edit to enter new items into the listbox and pushbuttons to add and remove items from the listbox and two buttons to move items up and down.

Definition at line 49 of file oeditlistbox.h.


Member Enumeration Documentation

enum OEditListBox::Button
 

Enumeration of the buttons, the listbox offers. Specify them in the constructor in the buttons parameter.

Enumeration values:
Add 
Remove 
UpDown 
All 

Definition at line 91 of file oeditlistbox.h.


Constructor & Destructor Documentation

OEditListBox::OEditListBox QWidget *  parent = 0,
const char *  name = 0,
bool  checkAtEntering = false,
int  buttons = All
 

Create an editable listbox.

If checkAtEntering is true, after every character you type in the line edit OEditListBox will enable or disable the Add-button, depending whether the current content of the line edit is already in the listbox. Maybe this can become a performance hit with large lists on slow machines. If checkAtEntering is false, it will be checked if you press the Add-button. It is not possible to enter items twice into the listbox.

Definition at line 57 of file oeditlistbox.cpp.

References init().

OEditListBox::OEditListBox const QString title,
QWidget *  parent = 0,
const char *  name = 0,
bool  checkAtEntering = false,
int  buttons = All
 

Create an editable listbox.

The same as the other constructor, additionally it takes , which will be the title of the frame around the listbox.

Definition at line 64 of file oeditlistbox.cpp.

References init().

OEditListBox::OEditListBox const QString title,
const CustomEditor customEditor,
QWidget *  parent = 0,
const char *  name = 0,
bool  checkAtEntering = false,
int  buttons = All
 

Another constructor, which allows to use a custom editing widget instead of the standard OLineEdit widget. E.g. you can use a OURLRequester or a OComboBox as input widget. The custom editor must consist of a lineedit and optionally another widget that is used as representation. A OComboBox or a OURLRequester have a OLineEdit as child-widget for example, so the OComboBox is used as the representation widget.

See also:
OURLRequester::customEditor()
Since:
3.1

Definition at line 71 of file oeditlistbox.cpp.

References init(), OEditListBox::CustomEditor::lineEdit(), m_lineEdit, and OEditListBox::CustomEditor::representationWidget().

OEditListBox::~OEditListBox  )  [virtual]
 

Definition at line 80 of file oeditlistbox.cpp.

References d.


Member Function Documentation

QPushButton* OEditListBox::addButton  )  const [inline]
 

Return a pointer to the Add button

Definition at line 147 of file oeditlistbox.h.

References servNewButton.

void OEditListBox::added const QString text  )  [signal]
 

This signal is emitted when the user adds a new string to the list, the parameter is the added string.

Since:
3.2

Referenced by addItem().

void OEditListBox::addItem  )  [protected, slot]
 

Definition at line 252 of file oeditlistbox.cpp.

References added(), changed(), OLineEdit::clear(), currentItem(), d, OEditListBoxPrivate::m_checkAtEntering, m_lineEdit, m_listBox, and servNewButton.

Referenced by init().

void OEditListBox::changed  )  [signal]
 

Referenced by addItem(), clear(), moveItemDown(), moveItemUp(), removeItem(), and typedSomething().

void OEditListBox::clear  ) 
 

Clears both the listbox and the line edit.

Definition at line 367 of file oeditlistbox.cpp.

References changed(), OLineEdit::clear(), m_lineEdit, and m_listBox.

int OEditListBox::count  )  const [inline]
 

See QListBox::count()

Definition at line 164 of file oeditlistbox.h.

References m_listBox.

Referenced by items(), and removeItem().

int OEditListBox::currentItem  )  const
 

See QListBox::currentItem()

Definition at line 300 of file oeditlistbox.cpp.

References m_listBox.

Referenced by addItem(), and typedSomething().

QString OEditListBox::currentText  )  const [inline]
 

See QListBox::currentText()

Definition at line 200 of file oeditlistbox.h.

References m_listBox.

Referenced by enableMoveButtons(), and typedSomething().

QPushButton* OEditListBox::downButton  )  const [inline]
 

Return a pointer to the Down button

Definition at line 159 of file oeditlistbox.h.

References servDownButton.

void OEditListBox::enableMoveButtons int  index  )  [protected, slot]
 

Definition at line 331 of file oeditlistbox.cpp.

References currentText(), m_lineEdit, m_listBox, servDownButton, servRemoveButton, and servUpButton.

Referenced by init().

void OEditListBox::init bool  checkAtEntering,
int  buttons,
QWidget *  representationWidget = 0L
[private]
 

Definition at line 86 of file oeditlistbox.cpp.

References Add, addItem(), OEditListBoxPrivate::buttons, d, enableMoveButtons(), i, OEditListBoxPrivate::m_checkAtEntering, m_lineEdit, m_listBox, moveItemDown(), moveItemUp(), Remove, removeItem(), row, servDownButton, servNewButton, servRemoveButton, servUpButton, OLineEdit::setTrapReturnKey(), tr, typedSomething(), and UpDown.

Referenced by OEditListBox().

void OEditListBox::insertItem const QString text,
int  index = -1
[inline]
 

See QListBox::insertItem()

Definition at line 184 of file oeditlistbox.h.

References m_listBox.

void OEditListBox::insertStringList const QStringList list,
int  index = -1
 

See QListBox::insertStringList()

Definition at line 374 of file oeditlistbox.cpp.

References m_listBox.

Referenced by OpieUIDemo::demoOEditListBox().

void OEditListBox::insertStrList const char **  list,
int  numStrings = -1,
int  index = -1
 

See QListBox::insertStrList()

Definition at line 389 of file oeditlistbox.cpp.

References m_listBox.

void OEditListBox::insertStrList const QStrList list,
int  index = -1
 

See QListBox::insertStrList()

Definition at line 384 of file oeditlistbox.cpp.

References m_listBox.

void OEditListBox::insertStrList const QStrList list,
int  index = -1
 

See QListBox::insertStringList()

Definition at line 379 of file oeditlistbox.cpp.

References m_listBox.

QStringList OEditListBox::items  )  const
 

Returns:
a stringlist of all items in the listbox

Definition at line 394 of file oeditlistbox.cpp.

References QValueList< T >::append(), count(), i, list, and m_listBox.

OLineEdit* OEditListBox::lineEdit  )  const [inline]
 

Return a pointer to the embedded QLineEdit.

Definition at line 143 of file oeditlistbox.h.

References m_lineEdit.

Referenced by OpieUIDemo::demoOEditListBox().

QListBox* OEditListBox::listBox  )  const [inline]
 

Return a pointer to the embedded QListBox.

Definition at line 139 of file oeditlistbox.h.

References m_listBox.

void OEditListBox::moveItemDown  )  [protected, slot]
 

Definition at line 229 of file oeditlistbox.cpp.

References changed(), and m_listBox.

Referenced by init().

void OEditListBox::moveItemUp  )  [protected, slot]
 

Definition at line 206 of file oeditlistbox.cpp.

References changed(), and m_listBox.

Referenced by init().

QPushButton* OEditListBox::removeButton  )  const [inline]
 

Return a pointer to the Remove button

Definition at line 151 of file oeditlistbox.h.

References servRemoveButton.

void OEditListBox::removed const QString text  )  [signal]
 

This signal is emitted when the user removes a string from the list, the parameter is the removed string.

Since:
3.2

Referenced by removeItem().

void OEditListBox::removeItem  )  [protected, slot]
 

Definition at line 311 of file oeditlistbox.cpp.

References changed(), count(), m_listBox, removed(), and servRemoveButton.

Referenced by init().

QString OEditListBox::text int  index  )  const [inline]
 

See QListBox::text()

Definition at line 192 of file oeditlistbox.h.

References m_listBox.

void OEditListBox::typedSomething const QString text  )  [protected, slot]
 

Definition at line 166 of file oeditlistbox.cpp.

References changed(), currentItem(), currentText(), d, QString::isEmpty(), OEditListBoxPrivate::m_checkAtEntering, m_lineEdit, m_listBox, and servNewButton.

Referenced by init().

QPushButton* OEditListBox::upButton  )  const [inline]
 

Return a pointer to the Up button

Definition at line 155 of file oeditlistbox.h.

References servUpButton.

void OEditListBox::virtual_hook int  id,
void *  data
[protected, virtual]
 

Definition at line 403 of file oeditlistbox.cpp.


Member Data Documentation

OEditListBoxPrivate* OEditListBox::d [private]
 

Definition at line 247 of file oeditlistbox.h.

Referenced by addItem(), init(), typedSomething(), and ~OEditListBox().

OLineEdit* OEditListBox::m_lineEdit [private]
 

Definition at line 237 of file oeditlistbox.h.

Referenced by addItem(), clear(), enableMoveButtons(), init(), lineEdit(), OEditListBox(), and typedSomething().

QListBox* OEditListBox::m_listBox [private]
 

Definition at line 234 of file oeditlistbox.h.

Referenced by addItem(), clear(), count(), currentItem(), currentText(), enableMoveButtons(), init(), insertItem(), insertStringList(), insertStrList(), items(), listBox(), moveItemDown(), moveItemUp(), removeItem(), text(), and typedSomething().

QPushButton * OEditListBox::servDownButton [private]
 

Definition at line 235 of file oeditlistbox.h.

Referenced by downButton(), enableMoveButtons(), and init().

QPushButton* OEditListBox::servNewButton [private]
 

Definition at line 236 of file oeditlistbox.h.

Referenced by addButton(), addItem(), init(), and typedSomething().

QPushButton * OEditListBox::servRemoveButton [private]
 

Definition at line 236 of file oeditlistbox.h.

Referenced by enableMoveButtons(), init(), removeButton(), and removeItem().

QPushButton* OEditListBox::servUpButton [private]
 

Definition at line 235 of file oeditlistbox.h.

Referenced by enableMoveButtons(), init(), and upButton().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:42:24 2005 for OPIE by  doxygen 1.4.2