Version: 9.12.0
QtxListAction::ListFrame Class Reference

Expanding frame with action list and comment. More...

Inheritance diagram for QtxListAction::ListFrame:
Inheritance graph

Public Member Functions

 ListFrame (QtxListAction *, QWidget *parent)
 Constructor. More...
 
virtual ~ListFrame ()
 Destructor. More...
 
void clear ()
 Clear list of names. More...
 
const QStringList names () const
 Get list of names. More...
 
void addNames (const QStringList &)
 Add names to the list. More...
 
void setSingleComment (const QString &)
 Set comment which is displayed when single name is selected. More...
 
void setMultipleComment (const QString &)
 Set comment which is displayed when multiple names are selected. More...
 
int selected () const
 Get number of selected names. More...
 
void setSelected (const int)
 Set number of selected names. More...
 
int linesNumber () const
 Get maximum numer of lines shown without activation of vertical scroll bar. More...
 
int charsNumber () const
 Get maximum numer of characters in the line. More...
 
void setLinesNumber (const int)
 Set maximum numer of lines shown without activation of vertical scroll bar. More...
 
void setCharsNumber (const int)
 Set maximum numer of characters in the line. More...
 
virtual QSize sizeHint () const
 Get preferable size for the list widget. More...
 
virtual QSize minimumSizeHint () const
 Get preferable minimum size for the list widget. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Process mouse events on the viewport of the list widget. More...
 
virtual void setVisible (bool)
 Called when list widget is shown/hidden. More...
 

Protected Member Functions

virtual void keyPressEvent (QKeyEvent *)
 Process key press event. More...
 

Private Member Functions

void accept ()
 Validate the action. More...
 
void updateComment ()
 Update displayed comment. More...
 
void setNames (const QStringList &)
 Set names to the list. More...
 
void removePostedEvens (QObject *, int)
 Filter all events of specified type sent to specified object. More...
 

Private Attributes

QListWidgetmyList
 
QStringList myNames
 
QtxListActionmyAction
 
QLabelmyComment
 
int myLines
 
int myChars
 
QString mySingleComment
 
QString myMultipleComment
 

Detailed Description

Expanding frame with action list and comment.

Constructor & Destructor Documentation

◆ ListFrame()

QtxListAction::ListFrame::ListFrame ( QtxListAction a,
QWidget parent 
)

Constructor.

Parameters
alist action
parentparent widget

References main(), myComment, myList, and myMultipleComment.

◆ ~ListFrame()

QtxListAction::ListFrame::~ListFrame ( )
virtual

Destructor.

Member Function Documentation

◆ accept()

void QtxListAction::ListFrame::accept ( )
private

Validate the action.

◆ addNames()

void QtxListAction::ListFrame::addNames ( const QStringList &  names)

Add names to the list.

Truncates each name to fit the frame width. Method QtxListAction::setCharsNumber(int) can be used to change the frame width (in characters).

Parameters
nameslist of names to be added
See also
setNames(), QtxListAction::setCharsNumber(int)

References QtxListAction::names().

◆ charsNumber()

int QtxListAction::ListFrame::charsNumber ( ) const

Get maximum numer of characters in the line.

If the name length is greater than this value, it will be truncated.

Returns
number of characters
See also
setCharsNumber(), linesNumber(), setLinesNumber()

◆ clear()

void QtxListAction::ListFrame::clear ( )

Clear list of names.

◆ eventFilter()

bool QtxListAction::ListFrame::eventFilter ( QObject o,
QEvent e 
)
virtual

Process mouse events on the viewport of the list widget.

Parameters
oobject recieving event (viewport)
eevent
Returns
true if further event processing should be stopped.

References QtxListAction::ScrollEvent::isDown(), and QtxListAction::ScrollEvent::Scroll.

◆ keyPressEvent()

void QtxListAction::ListFrame::keyPressEvent ( QKeyEvent *  e)
protectedvirtual

Process key press event.

The following keys are supported:

  • Up/Down
  • PageUp/PageDown
  • Enter
  • Escape
Parameters
ekey press event

References QtxListAction::linesNumber().

◆ linesNumber()

int QtxListAction::ListFrame::linesNumber ( ) const

Get maximum numer of lines shown without activation of vertical scroll bar.

Returns
number of lines
See also
setLinesNumber(), charsNumber(), setCharsNumber()

◆ minimumSizeHint()

QSize QtxListAction::ListFrame::minimumSizeHint ( ) const
virtual

Get preferable minimum size for the list widget.

Returns
preferable minimum size

References QtxListAction::charsNumber(), and QtxListAction::linesNumber().

◆ names()

const QStringList QtxListAction::ListFrame::names ( ) const

Get list of names.

Returns
list of names

◆ removePostedEvens()

void QtxListAction::ListFrame::removePostedEvens ( QObject o,
int  type 
)
private

Filter all events of specified type sent to specified object.

Parameters
oobject
typeevent type to be filtered

References QtxAction::eventFilter().

◆ selected()

int QtxListAction::ListFrame::selected ( ) const

Get number of selected names.

Returns
number of selected items

◆ setCharsNumber()

void QtxListAction::ListFrame::setCharsNumber ( const int  maxChars)

Set maximum numer of characters in the line.

If the name length is greater than this value, it will be truncated.

Parameters
maxCharsnumber of characters
See also
charsNumber(), linesNumber(), setLinesNumber()

◆ setLinesNumber()

void QtxListAction::ListFrame::setLinesNumber ( const int  maxLines)

Set maximum numer of lines shown without activation of vertical scroll bar.

Parameters
maxLinesnumber of lines
See also
linesNumber(), charsNumber(), setCharsNumber()

◆ setMultipleComment()

void QtxListAction::ListFrame::setMultipleComment ( const QString &  comment)

Set comment which is displayed when multiple names are selected.

Parameters
commentcomment format

◆ setNames()

void QtxListAction::ListFrame::setNames ( const QStringList &  names)
private

Set names to the list.

Truncates each name to fit the frame width. Method QtxListAction::setCharsNumber(int) can be used to change the frame width (in characters).

Parameters
nameslist of names to be set
See also
addNames(), QtxListAction::setCharsNumber(int)

References QtxListAction::charsNumber(), and QtxListAction::names().

◆ setSelected()

void QtxListAction::ListFrame::setSelected ( const int  lastSel)

Set number of selected names.

Parameters
lastSelnumber of items to be selected

References QtxListAction::ScrollEvent::Scroll.

◆ setSingleComment()

void QtxListAction::ListFrame::setSingleComment ( const QString &  comment)

Set comment which is displayed when single name is selected.

Parameters
commentcomment format

◆ setVisible()

void QtxListAction::ListFrame::setVisible ( bool  on)
virtual

Called when list widget is shown/hidden.

Parameters
onif true, widget is shown, otherswise it is hidden

◆ sizeHint()

QSize QtxListAction::ListFrame::sizeHint ( ) const
virtual

Get preferable size for the list widget.

Returns
preferable size

References QtxListAction::charsNumber(), and QtxListAction::linesNumber().

◆ updateComment()

void QtxListAction::ListFrame::updateComment ( )
private

Update displayed comment.

Member Data Documentation

◆ myAction

QtxListAction* QtxListAction::ListFrame::myAction
private

◆ myChars

int QtxListAction::ListFrame::myChars
private

◆ myComment

QLabel* QtxListAction::ListFrame::myComment
private

◆ myLines

int QtxListAction::ListFrame::myLines
private

◆ myList

QListWidget* QtxListAction::ListFrame::myList
private

◆ myMultipleComment

QString QtxListAction::ListFrame::myMultipleComment
private

◆ myNames

QStringList QtxListAction::ListFrame::myNames
private

◆ mySingleComment

QString QtxListAction::ListFrame::mySingleComment
private

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