Mantid
Loading...
Searching...
No Matches
HintingLineEdit.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2014 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include "Hint.h"
11#include "MantidQtWidgets/Common/DllOption.h"
12
13#include <QLineEdit>
14
15#include <map>
16#include <string>
17
18//------------------------------------------------------------------------------
19// Forward declaration
20//------------------------------------------------------------------------------
21class QLabel;
22
23namespace MantidQt {
24namespace MantidWidgets {
27class EXPORT_OPT_MANTIDQT_COMMON HintingLineEdit : public QLineEdit {
28 Q_OBJECT
29public:
30 HintingLineEdit(QWidget *parent, std::vector<Hint> hints);
31 ~HintingLineEdit() override;
32
33protected:
34 void keyPressEvent(QKeyEvent *e) override;
35 void updateMatches();
36 void showToolTip();
37 void insertSuggestion();
38 void clearSuggestion();
39 void nextSuggestion();
40 void prevSuggestion();
41 std::vector<Hint> m_matches;
42 std::vector<Hint> m_hints;
43 std::string m_currentPrefix; // m_curKey;
44 typename std::vector<Hint>::const_iterator m_match;
46 QLabel *m_hintLabel;
47protected slots:
48 void updateHints(const QString &text);
49 void hideHints();
50};
51} // namespace MantidWidgets
52} // namespace MantidQt
HintingLineEdit : A QLineEdit widget providing autocompletion.
std::vector< Hint >::const_iterator m_match
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...