1#ifndef TYPING_TEST_LAYER_H
2#define TYPING_TEST_LAYER_H
48 void Reset()
override;
SecurityLayer(QWidget *parent=nullptr)
Constructs a SecurityLayer.
Definition security_layer.h:20
QLineEdit * hidden_input_
Hidden input field used to capture user keystrokes without being visible.
Definition typing_test_layer.h:89
TypingTestLayer(QWidget *parent=nullptr)
Constructs a TypingTestLayer. Initializes the UI elements (title, instructions, text display panel,...
Definition typing_test_layer.cpp:13
~TypingTestLayer() override
Destructor.
Definition typing_test_layer.cpp:68
bool test_started_
Flag indicating if the user has started typing.
Definition typing_test_layer.h:98
void Reset() override
Resets the layer to its initial state. Clears the input field, resets progress tracking,...
Definition typing_test_layer.cpp:80
QString full_text_
The complete text passage the user needs to type.
Definition typing_test_layer.h:94
QLabel * title_label_
Label displaying the layer title ("TYPING VERIFICATION TEST").
Definition typing_test_layer.h:83
QLabel * display_text_label_
Label displaying the text passage to be typed, with dynamic highlighting.
Definition typing_test_layer.h:87
void UpdateHighlight() const
Updates the text display label after the test is successfully completed. Sets the entire text to gree...
Definition typing_test_layer.cpp:280
int current_position_
Index of the next character the user needs to type correctly in full_text_.
Definition typing_test_layer.h:96
QLabel * instructions_label_
Label displaying instructions for the user.
Definition typing_test_layer.h:85
bool test_completed_
Flag indicating if the user has successfully completed the typing test.
Definition typing_test_layer.h:100
void UpdateDisplayText() const
Updates the display_text_label_ with formatted rich text. Highlights correctly typed characters in gr...
Definition typing_test_layer.cpp:202
void OnTextChanged(const QString &text)
Slot called when the text in the hidden_input_ field changes. Validates the entered text against the ...
Definition typing_test_layer.cpp:230
void Initialize() override
Initializes the layer for display. Resets the layer state, sets focus on the hidden input field,...
Definition typing_test_layer.cpp:71
void GenerateWords()
Generates a random text passage composed of words from a predefined pool. Ensures the generated text ...
Definition typing_test_layer.cpp:103
QStringList words_
List of words composing the current text passage.
Definition typing_test_layer.h:92