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 "DllOption.h"
10#include "Hint.h"
12#include "MantidKernel/System.h"
13
14#include <QLineEdit>
15
16#include <map>
17#include <string>
18
19//------------------------------------------------------------------------------
20// Forward declaration
21//------------------------------------------------------------------------------
22class QLabel;
23
24namespace MantidQt {
25namespace MantidWidgets {
29 Q_OBJECT
30public:
31 HintingLineEdit(QWidget *parent, std::vector<Hint> hints);
32 ~HintingLineEdit() override;
33
34protected:
35 void keyPressEvent(QKeyEvent *e) override;
36 void updateMatches();
37 void showToolTip();
38 void insertSuggestion();
39 void clearSuggestion();
40 void nextSuggestion();
41 void prevSuggestion();
42 std::vector<Hint> m_matches;
43 std::vector<Hint> m_hints;
44 std::string m_currentPrefix; // m_curKey;
45 typename std::vector<Hint>::const_iterator m_match;
47 QLabel *m_hintLabel;
48protected slots:
49 void updateHints(const QString &text);
50 void hideHints();
51};
52} // namespace MantidWidgets
53} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
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...