#ifndef TAGEDIT_H
#define TAGEDIT_H

#include <QLineEdit>
#include <QLabel>
#include <QHBoxLayout>
#include <QPushButton>
#include "Tag.h"

class TagEdit : public QLineEdit
{
    Q_OBJECT
public:
    TagEdit(QWidget *parent = nullptr);

    void setText(const QString &);
    void clearAll();

protected:
	bool eventFilter(QObject * watched, QEvent * event) override;
    void addTag(const QString &text);

Q_SIGNALS:
	void tagChanged(QStringList);

public slots:
    void onEnter();

private slots:
    void onTagRemoved(Tag* tag);

private:
    void renderTags();
    void outputValue();

protected:
    QVector<Tag *> tags;
};

#endif // TAGEDIT_H
