-
Notifications
You must be signed in to change notification settings - Fork 122
/
HintingLineEdit.h
40 lines (36 loc) · 1.17 KB
/
HintingLineEdit.h
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
31
32
33
34
35
36
37
38
39
40
#ifndef MANTID_MANTIDWIDGETS_HINTINGLINEEDIT_H_
#define MANTID_MANTIDWIDGETS_HINTINGLINEEDIT_H_
#include "MantidKernel/System.h"
#include "MantidAPI/AlgorithmFactory.h"
#include "WidgetDllOption.h"
#include <map>
#include <QtGui>
#include <string>
//------------------------------------------------------------------------------
// Forward declaration
//------------------------------------------------------------------------------
namespace MantidQt
{
namespace MantidWidgets
{
class EXPORT_OPT_MANTIDQT_MANTIDWIDGETS HintingLineEdit : public QLineEdit
{
Q_OBJECT
public:
HintingLineEdit(QWidget *parent, const std::map<std::string,std::string> &hints);
virtual ~HintingLineEdit();
protected:
virtual void keyPressEvent(QKeyEvent* e);
void insertSuggestion();
void updateMatches();
std::string m_curKey;
std::map<std::string,std::string> m_matches;
std::map<std::string,std::string> m_hints;
bool m_dontComplete;
public slots:
void showHint();
void updateHint(const QString& text);
};
} //namespace MantidWidgets
} //namepsace MantidQt
#endif /* MANTID_MANTIDWIDGETS_HINTINGLINEEDIT_H_ */