Expanding frame with action list and comment. More...
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 | |
QListWidget * | myList |
QStringList | myNames |
QtxListAction * | myAction |
QLabel * | myComment |
int | myLines |
int | myChars |
QString | mySingleComment |
QString | myMultipleComment |
Expanding frame with action list and comment.
QtxListAction::ListFrame::ListFrame | ( | QtxListAction * | a, |
QWidget * | parent | ||
) |
Constructor.
a | list action |
parent | parent widget |
References main(), myComment, myList, and myMultipleComment.
|
virtual |
Destructor.
|
private |
Validate the action.
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).
names | list of names to be added |
References QtxListAction::names().
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.
void QtxListAction::ListFrame::clear | ( | ) |
Clear list of names.
Process mouse events on the viewport of the list widget.
o | object recieving event (viewport) |
e | event |
true
if further event processing should be stopped. References QtxListAction::ScrollEvent::isDown(), and QtxListAction::ScrollEvent::Scroll.
|
protectedvirtual |
Process key press event.
The following keys are supported:
e | key press event |
References QtxListAction::linesNumber().
int QtxListAction::ListFrame::linesNumber | ( | ) | const |
Get maximum numer of lines shown without activation of vertical scroll bar.
|
virtual |
Get preferable minimum size for the list widget.
References QtxListAction::charsNumber(), and QtxListAction::linesNumber().
const QStringList QtxListAction::ListFrame::names | ( | ) | const |
Get list of names.
|
private |
Filter all events of specified type sent to specified object.
o | object |
type | event type to be filtered |
References QtxAction::eventFilter().
int QtxListAction::ListFrame::selected | ( | ) | const |
Get number of selected names.
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.
maxChars | number of characters |
void QtxListAction::ListFrame::setLinesNumber | ( | const int | maxLines | ) |
Set maximum numer of lines shown without activation of vertical scroll bar.
maxLines | number of lines |
void QtxListAction::ListFrame::setMultipleComment | ( | const QString & | comment | ) |
Set comment which is displayed when multiple names are selected.
comment | comment format |
|
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).
names | list of names to be set |
References QtxListAction::charsNumber(), and QtxListAction::names().
void QtxListAction::ListFrame::setSelected | ( | const int | lastSel | ) |
Set number of selected names.
lastSel | number of items to be selected |
References QtxListAction::ScrollEvent::Scroll.
void QtxListAction::ListFrame::setSingleComment | ( | const QString & | comment | ) |
Set comment which is displayed when single name is selected.
comment | comment format |
|
virtual |
Called when list widget is shown/hidden.
on | if true , widget is shown, otherswise it is hidden |
|
virtual |
Get preferable size for the list widget.
References QtxListAction::charsNumber(), and QtxListAction::linesNumber().
|
private |
Update displayed comment.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |