MListFilter implements live filtering, for searching through the list content.
More...
Inherits QObject.
List of all members.
Detailed Description
MListFilter implements live filtering, for searching through the list content.
MListFilter creates a text editor and an item proxy model to be used to filter MList items. Application is responsible of putting the text editor into layout.
MListFilter filters items to match text editor content as a substring by default. This behaviour can be changed with setFilterMode. See FilterMode description for details.
Example of using list filtering with a custom regular expression by application:
Member Enumeration Documentation
This enumerated type is used by MListFilter to indicate how it filters items.
- Enumerator:
FilterAsSubstring |
Items are filtered to match text edit content as a substring
|
FilterAsBeginningOfLine |
Items are filtered to match text edit content in the beginning of line
|
FilterByApplication |
Application sets a regular expression by itself whenever text edit content changes.
|
Constructor & Destructor Documentation
MListFilter::MListFilter |
( |
MList * |
parent = NULL |
) |
|
Default constructor. Constructs the list filter.
- Parameters:
-
| parent | The list controller of the list filter content. |
MListFilter::~MListFilter |
( |
|
) |
[virtual] |
Default destructor. Cleanups and destroys the list filter.
Member Function Documentation
- Returns:
- text editor used in live filtering
void MListFilter::editorTextChanged |
( |
|
) |
[slot] |
Handles text changes in live filtering text editor. Updates live filtering model regular expression.
bool MListFilter::enabled |
( |
|
) |
|
- Returns:
true
if live filtering is enabled, otherwise false
- Returns:
- filter mode of a list
int MListFilter::filterRole |
( |
|
) |
const |
- Returns:
- filter role used in live filtering proxy. Default is Qt::DisplayRole
void MListFilter::keyPressEvent |
( |
QKeyEvent * |
event |
) |
|
Handling of key events - used to pass key presses to text editor when live filtering is enabled.
void MListFilter::listPannedUpFromTop |
( |
|
) |
[signal] |
Emitted when list is panned up starting from top position. This signal can be used in applications as a starter for list filtering with virtual keyboard.
- Returns:
- proxy model used in live filtering
void MListFilter::setEnabled |
( |
bool |
enabled |
) |
|
Sets live filtering to enabled or disabled. When live filtering is enabled list uses QSortFilterProxyModel as item model. By default live filtering is disabled.
Sets filter mode. By default FilterBySubstring is set. Check FilterMode enumeration for details.
void MListFilter::setFilterRole |
( |
int |
role |
) |
|
Sets filter role to be used in live filtering proxy. Default is Qt::DisplayRole.