OpenWalnut
1.5.0dev
|
A menu derived from QMenu with additional filtering. More...
#include <WQtMenuFiltered.h>
Public Slots | |
void | filterUpdate () |
Updates the filter. More... | |
void | resetFilter () |
Resets the filter. More... | |
Public Member Functions | |
WQtMenuFiltered (QAction *config=0, QWidget *parent=0) | |
Create filtered menu. More... | |
WQtMenuFiltered (const QString &title, QAction *config=0, QWidget *parent=0) | |
Create filtered menu. More... | |
virtual | ~WQtMenuFiltered () |
Destructor. More... | |
Protected Member Functions | |
virtual void | keyPressEvent (QKeyEvent *e) |
Grab key events. More... | |
void | hideEvent (QHideEvent *e) |
Called when hiding the menu. More... | |
Static Private Member Functions | |
static void | setupFilter (WQtMenuFiltered *to, QAction *config=0) |
Setup filter on given menu. More... | |
Private Attributes | |
QLineEdit * | m_edit |
Filter textfield. More... | |
A menu derived from QMenu with additional filtering.
Definition at line 39 of file WQtMenuFiltered.h.
WQtMenuFiltered::WQtMenuFiltered | ( | QAction * | config = 0 , |
QWidget * | parent = 0 |
||
) |
Create filtered menu.
parent | parent widget |
config | the optional configure action |
Definition at line 35 of file WQtMenuFiltered.cpp.
References setupFilter().
WQtMenuFiltered::WQtMenuFiltered | ( | const QString & | title, |
QAction * | config = 0 , |
||
QWidget * | parent = 0 |
||
) |
Create filtered menu.
title | the menu title |
parent | the parent |
config | the optional configure action |
Definition at line 41 of file WQtMenuFiltered.cpp.
References setupFilter().
|
virtual |
Destructor.
Definition at line 47 of file WQtMenuFiltered.cpp.
|
slot |
Updates the filter.
Definition at line 123 of file WQtMenuFiltered.cpp.
References m_edit, and string_utils::tokenize().
Referenced by setupFilter().
|
protected |
Called when hiding the menu.
Used to reset the filter.
e | the event |
Definition at line 117 of file WQtMenuFiltered.cpp.
References resetFilter().
|
protectedvirtual |
Grab key events.
Used for filtering.
e | the key event |
Definition at line 86 of file WQtMenuFiltered.cpp.
References m_edit, and resetFilter().
|
slot |
Resets the filter.
All elements are visible again.
Definition at line 177 of file WQtMenuFiltered.cpp.
References m_edit.
Referenced by hideEvent(), and keyPressEvent().
|
staticprivate |
Setup filter on given menu.
to | the menu |
config | optional config action shown in the filter |
Definition at line 52 of file WQtMenuFiltered.cpp.
References filterUpdate(), and m_edit.
Referenced by WQtMenuFiltered().
|
private |
Filter textfield.
Definition at line 101 of file WQtMenuFiltered.h.
Referenced by filterUpdate(), keyPressEvent(), resetFilter(), and setupFilter().