blob: 57c2aff35f51566fae432ee80a4790b31c64746e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
// Copyright (C) 2018 Benjamin Balga
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#pragma once
#include <QLineEdit>
namespace SerialTerminal {
namespace Internal {
class ConsoleLineEdit : public QLineEdit
{
public:
explicit ConsoleLineEdit(QWidget *parent = nullptr);
void addHistoryEntry();
void loadHistoryEntry(int entryIndex);
protected:
void keyPressEvent(QKeyEvent *event) final;
private:
QStringList m_history;
int m_maxEntries; // TODO: add to settings
int m_currentEntryIndex = 0;
QString m_editingEntry;
};
} // namespace Internal
} // namespace SerialTerminal
|