Mantid
|
HintingLineEdit : A QLineEdit widget providing autocompletion. More...
#include <HintingLineEdit.h>
Public Member Functions | |
HintingLineEdit (QWidget *parent, std::vector< Hint > hints) | |
~HintingLineEdit () override | |
Protected Slots | |
void | hideHints () |
Hides the list of hints. More... | |
void | updateHints (const QString &text) |
Rebuild a list of hints whenever the user edits the text, and use the hints to make auto completion suggestions. More... | |
Protected Member Functions | |
void | clearSuggestion () |
Remove any existing auto completion suggestion. More... | |
void | insertSuggestion () |
Insert an auto completion suggestion beneath the user's cursor and select it. More... | |
void | keyPressEvent (QKeyEvent *e) override |
Handle a key press event. More... | |
void | nextSuggestion () |
Change to the next available auto completion suggestion. More... | |
void | prevSuggestion () |
Change to the previous auto completion suggestion. More... | |
void | showToolTip () |
Show a tooltip with the current relevant hints. More... | |
void | updateMatches () |
Updates the list of hints matching the user's current input. More... | |
Protected Attributes | |
std::string | m_currentPrefix |
bool | m_dontComplete |
QLabel * | m_hintLabel |
std::vector< Hint > | m_hints |
std::vector< Hint >::const_iterator | m_match |
std::vector< Hint > | m_matches |
HintingLineEdit : A QLineEdit widget providing autocompletion.
Definition at line 28 of file HintingLineEdit.h.
MantidQt::MantidWidgets::HintingLineEdit::HintingLineEdit | ( | QWidget * | parent, |
std::vector< Hint > | hints | ||
) |
Definition at line 17 of file HintingLineEdit.cpp.
References hideHints(), m_hintLabel, and updateHints().
|
overridedefault |
|
protected |
Remove any existing auto completion suggestion.
Definition at line 143 of file HintingLineEdit.cpp.
Referenced by nextSuggestion(), and prevSuggestion().
|
protectedslot |
Hides the list of hints.
Definition at line 89 of file HintingLineEdit.cpp.
References m_hintLabel.
Referenced by HintingLineEdit().
|
protected |
Insert an auto completion suggestion beneath the user's cursor and select it.
Definition at line 123 of file HintingLineEdit.cpp.
References m_currentPrefix, m_dontComplete, m_match, and m_matches.
Referenced by nextSuggestion(), prevSuggestion(), and updateHints().
|
overrideprotected |
Handle a key press event.
e | : A pointer to the event |
Definition at line 40 of file HintingLineEdit.cpp.
References m_dontComplete, nextSuggestion(), and prevSuggestion().
|
protected |
Change to the next available auto completion suggestion.
Definition at line 154 of file HintingLineEdit.cpp.
References clearSuggestion(), insertSuggestion(), m_match, and m_matches.
Referenced by keyPressEvent().
|
protected |
Change to the previous auto completion suggestion.
Definition at line 166 of file HintingLineEdit.cpp.
References clearSuggestion(), insertSuggestion(), m_match, and m_matches.
Referenced by keyPressEvent().
|
protected |
Show a tooltip with the current relevant hints.
Definition at line 103 of file HintingLineEdit.cpp.
References height, m_hintLabel, and m_matches.
Referenced by updateHints().
|
protectedslot |
Rebuild a list of hints whenever the user edits the text, and use the hints to make auto completion suggestions.
text | : The new contents of the QLineEdit |
Definition at line 60 of file HintingLineEdit.cpp.
References insertSuggestion(), m_currentPrefix, showToolTip(), and updateMatches().
Referenced by HintingLineEdit().
|
protected |
Updates the list of hints matching the user's current input.
Definition at line 92 of file HintingLineEdit.cpp.
References m_hints, m_match, and m_matches.
Referenced by updateHints().
|
protected |
Definition at line 44 of file HintingLineEdit.h.
Referenced by insertSuggestion(), and updateHints().
|
protected |
Definition at line 46 of file HintingLineEdit.h.
Referenced by insertSuggestion(), and keyPressEvent().
|
protected |
Definition at line 47 of file HintingLineEdit.h.
Referenced by hideHints(), HintingLineEdit(), and showToolTip().
|
protected |
Definition at line 43 of file HintingLineEdit.h.
Referenced by updateMatches().
|
protected |
Definition at line 45 of file HintingLineEdit.h.
Referenced by insertSuggestion(), nextSuggestion(), prevSuggestion(), and updateMatches().
|
protected |
Definition at line 42 of file HintingLineEdit.h.
Referenced by insertSuggestion(), nextSuggestion(), prevSuggestion(), showToolTip(), and updateMatches().