wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
ExerciseOverlay.h
Go to the documentation of this file.
1// Copyright 2015 - 2026, GIBIS-UNIFESP and the wiRedPanda contributors
2// SPDX-License-Identifier: GPL-3.0-or-later
3
4#pragma once
5
6#include <QColor>
7#include <QWidget>
8
10
11class QLabel;
12class QPushButton;
13class ExerciseEngine;
14
16class ExerciseOverlay : public QWidget
17{
18 Q_OBJECT
19 friend class TestExerciseEngine;
20
21public:
22 explicit ExerciseOverlay(ExerciseEngine *engine, QWidget *parent = nullptr);
23
26 void repositionToParent();
27
28public slots:
29 void onStepChanged(int step, int total, const ExerciseStep &stepData);
31 void onRetranslated();
32
33signals:
35
36protected:
37 void paintEvent(QPaintEvent *event) override;
38
39private:
40 void setupUi();
41 void updateNextButton(bool isLastStep);
42 void applyTheme();
43
47 static int scaledFontPx(int basePx);
48
49 ExerciseEngine *m_engine;
50
51 QColor m_bgColor;
52 QColor m_textColor;
53 QColor m_hintColor;
54 QColor m_counterColor;
55
56 QLabel *m_stepCounter = nullptr;
57 QLabel *m_instructionLabel = nullptr;
58 QLabel *m_hintLabel = nullptr;
59 QPushButton *m_hintButton = nullptr;
60 QPushButton *m_prevButton = nullptr;
61 QPushButton *m_nextButton = nullptr;
62 QPushButton *m_closeButton = nullptr;
63
64 bool m_hintVisible = false;
65};
ExerciseOverlay(ExerciseEngine *engine, QWidget *parent=nullptr)
friend class TestExerciseEngine
void onStepChanged(int step, int total, const ExerciseStep &stepData)
void closeRequested()
void paintEvent(QPaintEvent *event) override