Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QtxListBox Class Reference

#include <QtxListBox.h>

Inheritance diagram for QtxListBox:
Inheritance graph

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 QValidatorvalidator () 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

QLineEditeditor () const
 
void createEditor ()
 
void updateEditor ()
 

Private Attributes

QLineEditmyEditor
 
int myEditIndex
 
bool myEditState
 
bool myEditDefault
 
bool myModifEnabled
 

Constructor & Destructor Documentation

QtxListBox::QtxListBox ( QWidget = 0,
const char *  = 0,
Qt::WindowFlags  = 0 
)

Constructor

References onContentsMoving().

QtxListBox::~QtxListBox ( )
virtual

Destructor

Member Function Documentation

void QtxListBox::clearValidator ( )
virtualslot

Removes validator of item editor

References editor().

void QtxListBox::createEditor ( )
private

Creates item editor

References myEditor.

void QtxListBox::createItem ( const int  i = -1)

Inserts empty item

Parameters
i- position of item (if it is less than 0, then current position is used)

References isEditEnabled(), and startEdition().

bool QtxListBox::defaultEditAction ( ) const
Returns
default edit action
See Also
setDefaultEditAction()

References myEditDefault.

void QtxListBox::deleteItem ( const int  i = -1)

Removes item

Parameters
i- position of item (if it is less than 0, then current position is used)

References defaultEditAction(), editedIndex(), endEdition(), isEditEnabled(), and updateEditor().

int QtxListBox::editedIndex ( ) const
Returns
current edited index

References myEditIndex.

QListBoxItem * QtxListBox::editedItem ( ) const
Returns
current edited item

References editedIndex().

QLineEdit * QtxListBox::editor ( ) const
private
Returns
item editor

References createEditor(), and myEditor.

void QtxListBox::endEdition ( const bool  action)

Finishes edition of item

Parameters
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.

Parameters
idx- index of item
void QtxListBox::ensureItemVisible ( const QListWidgetItem *  )
bool QtxListBox::eventFilter ( QObject o,
QEvent e 
)
virtual

Custom event filter, performs finish of edition on focus out, escape/return/enter pressing

References defaultEditAction(), editor(), and endEdition().

bool QtxListBox::isEditEnabled ( ) const
Returns
true if editing is enabled

References myEditState.

bool QtxListBox::isModificationEnabled ( ) const
Returns
modification enabled state
See Also
setModificationEnabled()

References myModifEnabled.

void QtxListBox::itemEdited ( int  )
signal
void QtxListBox::itemEdited ( QListWidgetItem *  )
signal
void QtxListBox::itemMoved ( int  ,
int   
)
signal
void QtxListBox::keyPressEvent ( QKeyEvent *  e)
protectedvirtual

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::mouseDoubleClickEvent ( QMouseEvent *  e)
protectedvirtual

Custom mouse double click event handler

References isEditEnabled(), and startEdition().

void QtxListBox::moveItem ( const int  idx,
const int  step 
)

Moves item

Parameters
idx- index of item
step- changing of position

References itemMoved(), myEditIndex, and updateEditor().

void QtxListBox::moveItemToBottom ( const int  idx)

Moves item to bottom

Parameters
idx- index of item

References moveItem().

void QtxListBox::moveItemToTop ( const int  idx)

Moves item to top

Parameters
idx- index of item

References moveItem().

void QtxListBox::onContentsMoving ( int  ,
int   
)
privateslot

Updates editor on contents moving

References updateEditor().

void QtxListBox::setContentsPos ( int  x,
int  y 
)
virtualslot

Scrolls the content so that the point is in the top-left corner.

Parameters
x,y- point co-ordinates

References updateEditor().

void QtxListBox::setDefaultEditAction ( bool  def)
virtualslot

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

Parameters
def- new value

References myEditDefault.

void QtxListBox::setEditEnabled ( bool  on)
virtualslot

Enables/disables editing

Parameters
on- new state

References defaultEditAction(), endEdition(), isEditEnabled(), and myEditState.

void QtxListBox::setModificationEnabled ( bool  on)
virtualslot

Changes "modification enabled" state If it is true, then pressing of CTRL + { Up, Down, Home, End } allows move items in list

Parameters
on- new state

References myModifEnabled.

void QtxListBox::setValidator ( const QValidator v)
virtualslot

Changes validator of item editor

Parameters
v- new validator

References editor().

void QtxListBox::startEdition ( const int  idx)

Starts edition of item

Parameters
idx- index of item

References defaultEditAction(), editedIndex(), editor(), endEdition(), ensureItemVisible(), isEditEnabled(), myEditIndex, and updateEditor().

void QtxListBox::startEdition ( const QListWidgetItem *  )
void QtxListBox::updateEditor ( )
private

Updates item editor

References editedIndex(), editedItem(), and editor().

const QValidator * QtxListBox::validator ( ) const
Returns
validator of item editor

References editor().

void QtxListBox::viewportResizeEvent ( QResizeEvent *  e)
protectedvirtual

Custom resize event handler

References updateEditor().

Member Data Documentation

bool QtxListBox::myEditDefault
private
int QtxListBox::myEditIndex
private
QLineEdit* QtxListBox::myEditor
private
bool QtxListBox::myEditState
private
bool QtxListBox::myModifEnabled
private

The documentation for this class was generated from the following files: