nextpnr/gui/line_editor.h

37 lines
594 B
C
Raw Normal View History

2018-06-20 15:42:47 +08:00
#ifndef LINE_EDITOR_H
#define LINE_EDITOR_H
#include <QLineEdit>
#include <QMenu>
2018-06-22 19:10:27 +08:00
#include "nextpnr.h"
NEXTPNR_NAMESPACE_BEGIN
2018-06-20 15:42:47 +08:00
class LineEditor : public QLineEdit
{
Q_OBJECT
public:
explicit LineEditor(QWidget *parent = 0);
private Q_SLOTS:
void textInserted();
void showContextMenu(const QPoint &pt);
void clearHistory();
Q_SIGNALS:
void textLineInserted(QString);
protected:
void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE;
private:
int index;
QStringList lines;
QMenu *contextMenu;
};
2018-06-22 19:10:27 +08:00
NEXTPNR_NAMESPACE_END
2018-06-20 15:42:47 +08:00
#endif // LINE_EDITOR_H