|
Albert
|
#include <albert/queryresults.h>
Query results container.
Holds the results of a Query and emits signals as expected by the UI models.
Public Member Functions | |
| QueryResults (const QueryContext &context) | |
| Constructs query results with the context it belongs to. | |
| ~QueryResults () override | |
| Destructs the query results. | |
| QueryResult & | operator[] (size_t index) |
| Returns the result at index index. | |
| const QueryResult & | operator[] (size_t index) const |
| Returns the result at index index. | |
| uint | count () const |
| Returns the number of results. | |
| bool | activate (uint item_index, uint action_index=0) |
| Activates the action at action_index of the result item at item_index. | |
| void | add (const Extension &extension, ItemPtr auto &&item) |
| Appends a QueryResult constructed from extension and item. | |
| void | add (ItemPtr auto &&item) |
| Appends a QueryResult constructed from item and the handler this results belong to. | |
| void | add (std::ranges::range auto &&query_results) |
| Appends query_results to the results. | |
| void | add (const Extension &extension, ItemRange auto &&items) |
| Appends QueryResult's constructed from extension and items. | |
| void | add (ItemRange auto &&items) |
| Appends QueryResult's constructed from items and the handler this results belong to. | |
| void | remove (uint index, uint count=1) |
| Removes count results starting from index. | |
| void | reset () |
| Removes all results. | |
|
inline |
Appends a QueryResult constructed from extension and item.
Use the range add methods to avoid UI flicker.
|
inline |
Appends a QueryResult constructed from item and the handler this results belong to.
Use the range add methods to avoid UI flicker.