![]() |
Plasma Engine
2.0
|
Implements an item for insertion into a QMenu that shows a search bar and a hierarchical list of options. More...
#include <SearchableMenu.moc.h>

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 |
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.