Main application window of SyntaxTutor, managing levels, exercises, and UI state. More...
#include <mainwindow.h>
Signals | |
void | userLevelChanged (unsigned lvl) |
Emitted when the user's level changes. | |
void | userLevelUp (unsigned newLevel) |
Emitted when the user levels up. | |
Public Member Functions | |
MainWindow (QWidget *parent=nullptr) | |
Constructs the main window. | |
~MainWindow () | |
Destructor. | |
unsigned | thresholdFor (unsigned level) |
Returns the required score threshold to unlock a level. | |
unsigned | userLevel () const |
Returns the current user level. | |
void | setUserLevel (unsigned lvl) |
Sets the user level, clamping it to the allowed maximum. | |
Properties | |
unsigned | userLevel |
Main application window of SyntaxTutor, managing levels, exercises, and UI state.
This class serves as the central hub of the application. It handles level selection, navigation to LL(1) and SLR(1) exercises, tutorial management, settings persistence, and emits signals for user progress. It also includes UI logic for dynamic behavior like unlocking levels and changing language.
MainWindow::MainWindow | ( | QWidget * | parent = nullptr | ) |
Constructs the main window.
parent | Parent widget. |
MainWindow::~MainWindow | ( | ) |
Destructor.
|
inline |
Sets the user level, clamping it to the allowed maximum.
lvl | New level to assign. |
|
inline |
Returns the required score threshold to unlock a level.
level | The level number. |
|
inline |
Returns the current user level.
|
signal |
Emitted when the user's level changes.
lvl | New user level. |
|
signal |
Emitted when the user levels up.
newLevel | The new level achieved. |
|
readwrite |