#include <QtxListBox.h>

Public Slots | |
| virtual void | setEditEnabled (bool) |
| virtual void | setDefaultEditAction (bool) |
| virtual void | setModificationEnabled (bool) |
| virtual void | clearValidator () |
| virtual void | setValidator (const QValidator *) |
| virtual void | setContentsPos (int, int) |
Signals | |
| void | itemEdited (int) |
| void | itemEdited (QListWidgetItem *) |
| void | itemMoved (int, int) |
Public Member Functions | |
| QtxListBox (QWidget *=0, const char *=0, Qt::WindowFlags=0) | |
| virtual | ~QtxListBox () |
| bool | isEditEnabled () const |
| bool | defaultEditAction () const |
| bool | isModificationEnabled () const |
| QListWidgetItem * | editedItem () const |
| int | editedIndex () const |
| void | startEdition (const int) |
| void | startEdition (const QListWidgetItem *) |
| void | endEdition (const bool) |
| void | ensureItemVisible (const int) |
| void | ensureItemVisible (const QListWidgetItem *) |
| virtual bool | eventFilter (QObject *, QEvent *) |
| const QValidator * | validator () const |
| void | moveItemToTop (const int) |
| void | moveItemToBottom (const int) |
| void | moveItem (const int, const int) |
| void | createItem (const int=-1) |
| void | deleteItem (const int=-1) |
Protected Member Functions | |
| virtual void | keyPressEvent (QKeyEvent *) |
| virtual void | viewportResizeEvent (QResizeEvent *) |
| virtual void | mouseDoubleClickEvent (QMouseEvent *) |
Private Slots | |
| void | onContentsMoving (int, int) |
Private Member Functions | |
| QLineEdit * | editor () const |
| void | createEditor () |
| void | updateEditor () |
Private Attributes | |
| QLineEdit * | myEditor |
| int | myEditIndex |
| bool | myEditState |
| bool | myEditDefault |
| bool | myModifEnabled |
| QtxListBox::QtxListBox | ( | QWidget * | = 0, |
| const char * | = 0, |
||
| Qt::WindowFlags | = 0 |
||
| ) |
Constructor
References onContentsMoving().
| QtxListBox::~QtxListBox | ( | ) | [virtual] |
Destructor
| bool QtxListBox::isEditEnabled | ( | ) | const |
References myEditState.
| bool QtxListBox::defaultEditAction | ( | ) | const |
| bool QtxListBox::isModificationEnabled | ( | ) | const |
| QListBoxItem * QtxListBox::editedItem | ( | ) | const |
References editedIndex().
| int QtxListBox::editedIndex | ( | ) | const |
References myEditIndex.
| void QtxListBox::startEdition | ( | const int | idx | ) |
Starts edition of item
| idx | - index of item |
References defaultEditAction(), editedIndex(), editor(), endEdition(), ensureItemVisible(), isEditEnabled(), myEditIndex, and updateEditor().
| void QtxListBox.startEdition | ( | const QListWidgetItem * | ) |
| void QtxListBox::endEdition | ( | const bool | action | ) |
Finishes edition of item
| action | - if it is true, then new values must be accepted |
References editedIndex(), editor(), itemEdited(), and myEditIndex.
| void QtxListBox::ensureItemVisible | ( | const int | idx | ) |
Ensures that the item is visible.
| idx | - index of item |
| void QtxListBox.ensureItemVisible | ( | const QListWidgetItem * | ) |
Custom event filter, performs finish of edition on focus out, escape/return/enter pressing
References defaultEditAction(), editor(), and endEdition().
| const QValidator * QtxListBox::validator | ( | ) | const |
References editor().
| void QtxListBox::moveItemToTop | ( | const int | idx | ) |
| void QtxListBox::moveItemToBottom | ( | const int | idx | ) |
| void QtxListBox::moveItem | ( | const int | idx, |
| const int | step | ||
| ) |
Moves item
| idx | - index of item |
| step | - changing of position |
References itemMoved(), myEditIndex, and updateEditor().
| void QtxListBox::createItem | ( | const int | i = -1 | ) |
Inserts empty item
| i | - position of item (if it is less than 0, then current position is used) |
References isEditEnabled(), and startEdition().
| void QtxListBox::deleteItem | ( | const int | i = -1 | ) |
Removes item
| i | - position of item (if it is less than 0, then current position is used) |
References defaultEditAction(), editedIndex(), endEdition(), isEditEnabled(), and updateEditor().
| void QtxListBox.itemEdited | ( | int | ) | [signal] |
| void QtxListBox.itemEdited | ( | QListWidgetItem * | ) | [signal] |
| void QtxListBox.itemMoved | ( | int | , |
| int | |||
| ) | [signal] |
| void QtxListBox::setEditEnabled | ( | bool | on | ) | [virtual, slot] |
Enables/disables editing
| on | - new state |
References defaultEditAction(), endEdition(), isEditEnabled(), and myEditState.
| void QtxListBox::setDefaultEditAction | ( | bool | def | ) | [virtual, slot] |
Changes default edit action. Pressing of ENTER button always accepts new value of edited item. But other ways, such as focus out or edition of other item accepts new value of edited item only if "default edit action" is true
| def | - new value |
References myEditDefault.
| void QtxListBox::setModificationEnabled | ( | bool | on | ) | [virtual, slot] |
Changes "modification enabled" state If it is true, then pressing of CTRL + { Up, Down, Home, End } allows move items in list
| on | - new state |
References myModifEnabled.
| void QtxListBox::clearValidator | ( | ) | [virtual, slot] |
Removes validator of item editor
References editor().
| void QtxListBox::setValidator | ( | const QValidator * | v | ) | [virtual, slot] |
| void QtxListBox::setContentsPos | ( | int | x, |
| int | y | ||
| ) | [virtual, slot] |
Scrolls the content so that the point is in the top-left corner.
| x,y | - point co-ordinates |
References updateEditor().
| void QtxListBox::onContentsMoving | ( | int | , |
| int | |||
| ) | [private, slot] |
Updates editor on contents moving
References updateEditor().
| void QtxListBox::keyPressEvent | ( | QKeyEvent * | e | ) | [protected, virtual] |
Custom key press event handler Allows to move items by CTRL + { Up, Down, Home, End }
References createItem(), deleteItem(), isModificationEnabled(), moveItem(), moveItemToBottom(), and moveItemToTop().
| void QtxListBox::viewportResizeEvent | ( | QResizeEvent * | e | ) | [protected, virtual] |
Custom resize event handler
References updateEditor().
| void QtxListBox::mouseDoubleClickEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Custom mouse double click event handler
References isEditEnabled(), and startEdition().
| QLineEdit * QtxListBox::editor | ( | ) | const [private] |
References createEditor(), and myEditor.
| void QtxListBox::createEditor | ( | ) | [private] |
Creates item editor
References myEditor.
| void QtxListBox::updateEditor | ( | ) | [private] |
Updates item editor
References editedIndex(), editedItem(), and editor().
QLineEdit* QtxListBox.myEditor [private] |
int QtxListBox.myEditIndex [private] |
bool QtxListBox.myEditState [private] |
bool QtxListBox.myEditDefault [private] |
bool QtxListBox.myModifEnabled [private] |