subsurface/qt-ui/tagwidget.h
Tomaz Canabrava 30770f5d85 Do not copy strings when you don't need it.
This patch removed the use of copy-constructors on the QString to use the
const-references. Even knowing that the QString is a refcounted class,
let's not get that bad habit.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-03-20 09:47:57 -07:00

32 lines
681 B
C++

#ifndef TAGWIDGET_H
#define TAGWIDGET_H
#include "groupedlineedit.h"
#include <QCompleter>
#include <QPair>
class TagWidget : public GroupedLineEdit {
Q_OBJECT
public:
explicit TagWidget(QWidget *parent = 0);
void setCompleter(QCompleter *completer);
QPair<int, int> getCursorTagPosition();
void highlight();
void setText(const QString& text);
void clear();
void setCursorPosition(int position);
void wheelEvent(QWheelEvent *event);
public
slots:
void reparse();
void completionSelected(const QString& text);
void completionHighlighted(const QString& text);
protected:
void keyPressEvent(QKeyEvent *e);
private:
QCompleter *m_completer;
};
#endif // TAGWIDGET_H