Plasma Engine  2.0
Loading...
Searching...
No Matches
plQtSearchableMenu Class Reference

Implements an item for insertion into a QMenu that shows a search bar and a hierarchical list of options. More...

#include <SearchableMenu.moc.h>

Inheritance diagram for plQtSearchableMenu:

Signals

void MenuItemTriggered (const QString &sName, const QVariant &variant)
 Signaled when an item is double clicked or otherwise selected for activation.
 
void SearchTextChanged (const QString &sText)
 Triggered whenever the search text is modified.
 

Public Member Functions

 plQtSearchableMenu (QObject *pParent)
 The parent should usually be a QMenu into which this QWidgetAction is inserted as an action.
 
void AddItem (plStringView sDisplayName, const char *szInternalPath, const QVariant &variant, QIcon icon=QIcon())
 Use slashes in the szInternalPath to separate sub-items.
 
QString GetSearchText () const
 Returns the currently entered search text.
 
void Finalize (const QString &sSearchText)
 Sets up the internal data model and ensures the menu's search bar gets input focus. Do this after adding the item to the parent menu.
 

Protected Member Functions

virtual bool eventFilter (QObject *, QEvent *) override
 

Detailed Description

Implements an item for insertion into a QMenu that shows a search bar and a hierarchical list of options.

Fill the searchable menu object with items (use slashes to indicate hierarchy) then use QMenu::addAction to insert it into another QMenu. Connect to MenuItemTriggered() to handle the item activation and also call QMenu::close() on the parent menu.


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