SyntaxTutor
Educational app designed to help compiler students understand LL(1) and SLR(1) parsing algorithms.
 
Loading...
Searching...
No Matches
MainWindow Class Reference

Main application window of SyntaxTutor, managing levels, exercises, and UI state. More...

#include <mainwindow.h>

Inheritance diagram for MainWindow:
Collaboration diagram for MainWindow:

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MainWindow()

MainWindow::MainWindow ( QWidget * parent = nullptr)

Constructs the main window.

Parameters
parentParent widget.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~MainWindow()

MainWindow::~MainWindow ( )

Destructor.

Member Function Documentation

◆ setUserLevel()

void MainWindow::setUserLevel ( unsigned lvl)
inline

Sets the user level, clamping it to the allowed maximum.

Parameters
lvlNew level to assign.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ thresholdFor()

unsigned MainWindow::thresholdFor ( unsigned level)
inline

Returns the required score threshold to unlock a level.

Parameters
levelThe level number.
Returns
The score needed to unlock the given level.

◆ userLevel()

unsigned MainWindow::userLevel ( ) const
inline

Returns the current user level.

◆ userLevelChanged

void MainWindow::userLevelChanged ( unsigned lvl)
signal

Emitted when the user's level changes.

Parameters
lvlNew user level.
Here is the caller graph for this function:

◆ userLevelUp

void MainWindow::userLevelUp ( unsigned newLevel)
signal

Emitted when the user levels up.

Parameters
newLevelThe new level achieved.
Here is the caller graph for this function:

Property Documentation

◆ userLevel

unsigned MainWindow::userLevel
readwrite

The documentation for this class was generated from the following files: