#include <albert/inputhistory.h>
Inherits QObject.
Input history class.
Stores input strings and provides a search iterator.
|
| InputHistory (const QString &path={}) |
|
| ~InputHistory () override |
|
Q_INVOKABLE void | add (const QString &str) |
| Adds text to history search.
|
|
Q_INVOKABLE QString | next (const QString &pattern=QString{}) |
| Gets next history item matching the pattern.
|
|
Q_INVOKABLE QString | prev (const QString &pattern=QString{}) |
| Gets previous history item matching the pattern.
|
|
Q_INVOKABLE void | resetIterator () |
| Resets history search.
|
|
Q_INVOKABLE void | clear () |
| Clears the history.
|
|
Q_INVOKABLE uint | limit () const |
| Returns the maximum amount of history entries.
|
|
Q_INVOKABLE void | setLimit (uint) |
| Sets the maximum amount of history entries.
|
|
◆ InputHistory()
albert::util::InputHistory::InputHistory |
( |
const QString & |
path = {} | ) |
|
◆ ~InputHistory()
albert::util::InputHistory::~InputHistory |
( |
| ) |
|
|
override |
◆ add()
Q_INVOKABLE void albert::util::InputHistory::add |
( |
const QString & |
str | ) |
|
Adds text to history search.
Skips empty strings and drops duplicates.
- Parameters
-
◆ clear()
Q_INVOKABLE void albert::util::InputHistory::clear |
( |
| ) |
|
◆ limit()
Q_INVOKABLE uint albert::util::InputHistory::limit |
( |
| ) |
const |
Returns the maximum amount of history entries.
◆ next()
Q_INVOKABLE QString albert::util::InputHistory::next |
( |
const QString & |
pattern = QString{} | ) |
|
Gets next history item matching the pattern.
- Parameters
-
pattern | A pattern used to filter the history items. |
- Returns
- The next history item matching the pattern or empty string.
◆ prev()
Q_INVOKABLE QString albert::util::InputHistory::prev |
( |
const QString & |
pattern = QString{} | ) |
|
Gets previous history item matching the pattern.
- Parameters
-
pattern | A pattern used to filter the history items. |
- Returns
- The previous history item matching the pattern or empty string.
◆ resetIterator()
Q_INVOKABLE void albert::util::InputHistory::resetIterator |
( |
| ) |
|
◆ setLimit()
Q_INVOKABLE void albert::util::InputHistory::setLimit |
( |
uint |
| ) |
|
Sets the maximum amount of history entries.
The documentation for this class was generated from the following file: