13 if (m_history.
isEmpty())
return {};
14 return m_history.
first();
26 const int key =
event->key();
27 bool nonEmpty =
false;
32 if (m_history.
size() > m_position) { this->
setText(m_history.
at(m_position++)); }
42 if (m_position == m_history.
size()) { --m_position; }
43 if (m_position > 0 && m_history.
size() > --m_position) { this->
setText(m_history.
at(m_position)); }
65 if (!
event) {
return; }
virtual void keyPressEvent(QKeyEvent *event)
virtual void contextMenuEvent(QContextMenuEvent *event)
QString getLastEnteredLineFormatted() const
Get the last entered line but simplified and trimmed.
void returnPressedUnemptyLine()
Return has been pressed, line is NOT empty (spaces are trimmed)
QString getLastEnteredLine() const
Get the last entered line.
void clearHistory()
Clear the history.
void triggered(bool checked)
QMenu * createStandardContextMenu()
virtual bool event(QEvent *e) override
virtual void keyPressEvent(QKeyEvent *event) override
void setText(const QString &)
QList< T >::const_reference at(qsizetype i) const const
bool isEmpty() const const
void push_front(QList< T >::parameter_type value)
qsizetype size() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool isEmpty() const const
QString simplified() const const
QString trimmed() const const