2014-02-11 18:14:46 +00:00
|
|
|
#ifndef TAGWIDGET_H
|
|
|
|
#define TAGWIDGET_H
|
2013-11-02 01:20:02 +00:00
|
|
|
|
|
|
|
#include "groupedlineedit.h"
|
|
|
|
#include <QCompleter>
|
|
|
|
#include <QPair>
|
|
|
|
|
2014-02-28 04:09:57 +00:00
|
|
|
class TagWidget : public GroupedLineEdit {
|
|
|
|
Q_OBJECT
|
2013-11-02 01:20:02 +00:00
|
|
|
public:
|
2014-02-28 04:09:57 +00:00
|
|
|
explicit TagWidget(QWidget *parent = 0);
|
2013-11-02 01:20:02 +00:00
|
|
|
void setCompleter(QCompleter *completer);
|
|
|
|
QPair<int, int> getCursorTagPosition();
|
|
|
|
void highlight();
|
2014-03-19 18:29:13 +00:00
|
|
|
void setText(const QString& text);
|
2013-11-02 01:20:02 +00:00
|
|
|
void clear();
|
|
|
|
void setCursorPosition(int position);
|
2014-01-19 15:33:24 +00:00
|
|
|
void wheelEvent(QWheelEvent *event);
|
2014-02-28 04:09:57 +00:00
|
|
|
public
|
|
|
|
slots:
|
2014-02-09 17:35:23 +00:00
|
|
|
void reparse();
|
2014-03-19 18:29:13 +00:00
|
|
|
void completionSelected(const QString& text);
|
|
|
|
void completionHighlighted(const QString& text);
|
2014-02-28 04:09:57 +00:00
|
|
|
|
2013-11-02 16:04:18 +00:00
|
|
|
protected:
|
|
|
|
void keyPressEvent(QKeyEvent *e);
|
2014-02-28 04:09:57 +00:00
|
|
|
|
2013-11-02 01:20:02 +00:00
|
|
|
private:
|
2014-02-09 17:35:23 +00:00
|
|
|
QCompleter *m_completer;
|
2014-05-16 06:12:46 +00:00
|
|
|
bool lastFinishedTag;
|
2013-11-02 01:20:02 +00:00
|
|
|
};
|
|
|
|
|
2014-02-11 18:14:46 +00:00
|
|
|
#endif // TAGWIDGET_H
|