-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ISSUE #131][SEARCH] Length of search box
- Switch regex input field from QLineEdit to QTextEdit - Adapt dependent source code - Update the development documentation - Update README.md Signed-off-by: Vladyslav Goncharuk <vladyslav_goncharuk@epam.com>
- Loading branch information
Vladyslav Goncharuk
committed
Nov 13, 2024
1 parent
00d10f8
commit b38fb35
Showing
99 changed files
with
1,572 additions
and
1,089 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 0 additions & 74 deletions
74
dltmessageanalyzerplugin/src/components/regexHistory/api/CRegexHistoryLineEdit.hpp
This file was deleted.
Oops, something went wrong.
122 changes: 122 additions & 0 deletions
122
dltmessageanalyzerplugin/src/components/regexHistory/api/CRegexHistoryTextEdit.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
#pragma once | ||
|
||
#include "QTextEdit" | ||
#include "QKeyEvent" | ||
#include "QWidget" | ||
|
||
#include "components/settings/api/CSettingsManagerClient.hpp" | ||
|
||
class QCompleter; | ||
|
||
#include "components/regexHistory/api/IRegexHistoryProvider.hpp" | ||
|
||
/** | ||
* @brief A custom QTextEdit with regex history support. | ||
* | ||
* This class extends QTextEdit to include features for managing regex history | ||
* and handling specific key events. | ||
*/ | ||
class CRegexHistoryTextEdit : public QTextEdit, | ||
public CSettingsManagerClient | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
|
||
/** | ||
* @brief Constructs a CRegexHistoryTextEdit object. | ||
* | ||
* @param parent The parent widget for the text edit. Defaults to nullptr. | ||
*/ | ||
explicit CRegexHistoryTextEdit(QWidget *parent = nullptr); | ||
|
||
/** | ||
* @brief Sets the regex history provider. | ||
* | ||
* This method associates a regex history provider. | ||
* | ||
* @param pRegexHistoryProviderPtr Shared pointer to the regex history provider. | ||
*/ | ||
void setRegexHistoryProvider(const tRegexHistoryProviderPtr& pRegexHistoryProviderPtr); | ||
|
||
/** | ||
* @brief Sets whether to ignore return key events. | ||
* | ||
* This method allows control over whether the line edit should handle | ||
* return (Enter) key events or ignore them. | ||
* | ||
* @param val True to ignore return key events, false otherwise. | ||
*/ | ||
void setIgnoreReturnKeyEvent(bool val); | ||
|
||
/** | ||
* @brief Checks whether return key events are ignored. | ||
* | ||
* This method returns whether the line edit is currently set to ignore | ||
* return key events. | ||
* | ||
* @return bool True if return key events are ignored, false otherwise. | ||
*/ | ||
bool getIgnoreReturnKeyEvent() const; | ||
|
||
/** | ||
* @brief Activates regex history. | ||
* | ||
* This method activates the regex history. | ||
*/ | ||
void activateRegexHistory(); | ||
|
||
/** | ||
* @brief Sets the completer for the text edit. | ||
* | ||
* This method allows setting a QCompleter to provide text completions. | ||
* | ||
* @param pCompleter Pointer to the QCompleter instance. | ||
*/ | ||
void setCompleter(QCompleter* pCompleter); | ||
|
||
/** | ||
* @brief Gets the current completer. | ||
* | ||
* This method returns the current QCompleter instance used by the text edit. | ||
* | ||
* @return QCompleter* Pointer to the current QCompleter. | ||
*/ | ||
QCompleter *completer() const; | ||
|
||
/** | ||
* @brief Sets the selection range within the text. | ||
* | ||
* This method allows setting a selection starting at a given position with | ||
* a specified length. | ||
* | ||
* @param start The starting position of the selection. | ||
* @param length The length of the selection. | ||
*/ | ||
void setSelection(int start, int length); | ||
|
||
signals: | ||
/** | ||
* @brief Signal emitted when the return key is pressed. | ||
*/ | ||
void returnPressed(); | ||
|
||
private slots: | ||
void insertCompletion(const QString &completion); | ||
|
||
protected: | ||
void insertFromMimeData(const QMimeData *source) override; | ||
void resizeEvent(QResizeEvent *event) override; | ||
virtual void focusInEvent(QFocusEvent *event) override; | ||
void keyPressEvent(QKeyEvent *event) override; | ||
void handleSettingsManagerChange() override; | ||
|
||
private: | ||
QString textUnderCursor() const; | ||
void adjustHeightToContent(); | ||
|
||
private: | ||
tRegexHistoryProviderPtr mpRegexHistoryProvider; | ||
bool mbIgnoreReturnKeyEvent; | ||
QCompleter* mpCompleter; | ||
}; |
4 changes: 2 additions & 2 deletions
4
dltmessageanalyzerplugin/src/components/regexHistory/src/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.