Manages the user interface for tasks and subtasks.
More...
#include <task_ui.hpp>
|
| TaskUI (QVBoxLayout *subtaskListLayout, QLabel *mainTitleLabel, QLabel *difficultyLabel, QLabel *folderLabel, QLabel *topicLabel, QPushButton *nextButton, QPushButton *previousButton, QToolButton *menuButton, QToolButton *resetRobotStartButton, QFrame *resetRobotFrame, QWidget *centralwidget, QWidget *parent=nullptr) |
| Constructs a TaskUI object. More...
|
|
void | initializeUI (const QVector< QSharedPointer< Task >> &tasks) |
| Initializes the UI with the loaded tasks. More...
|
|
void | setTaskUI (int currentTaskIndex, const QVector< QSharedPointer< Task >> &tasks) |
| Sets the UI elements for the current task. More...
|
|
void | updateSubtaskItemsUI () |
| Updates the UI elements for the subtasks. More...
|
|
void | setTaskManager (TaskManager *manager) |
| Sets the TaskManager object. More...
|
|
void | startedRobotResetUI (bool noSubtasksLeft) |
| Update the UI to show that the robot reset has been started. More...
|
|
void | finishedRobotResetUI () |
| Update the UI to show that the robot reset has finished. More...
|
|
void | failedRobotResetUI (const QString &error) |
| Update the UI to show that the robot reset has failed. More...
|
|
Manages the user interface for tasks and subtasks.
The TaskUI class is responsible for initializing and updating the UI elements related to tasks and subtasks. It interacts with the TaskManager and Sidebar to provide a cohesive user experience.
◆ TaskUI()
TaskUI::TaskUI |
( |
QVBoxLayout * |
subtaskListLayout, |
|
|
QLabel * |
mainTitleLabel, |
|
|
QLabel * |
difficultyLabel, |
|
|
QLabel * |
folderLabel, |
|
|
QLabel * |
topicLabel, |
|
|
QPushButton * |
nextButton, |
|
|
QPushButton * |
previousButton, |
|
|
QToolButton * |
menuButton, |
|
|
QToolButton * |
resetRobotStartButton, |
|
|
QFrame * |
resetRobotFrame, |
|
|
QWidget * |
centralwidget, |
|
|
QWidget * |
parent = nullptr |
|
) |
| |
Constructs a TaskUI object.
- Parameters
-
subtaskListLayout | Pointer to the vertical layout for displaying subtasks. |
mainTitleLabel | Pointer to the QLabel for displaying the main title. |
difficultyLabel | Pointer to the QLabel for displaying the difficulty level. |
folderLabel | Pointer to the QLabel for displaying the folder information. |
nextButton | Pointer to the QPushButton for navigating to the next task. |
previousButton | Pointer to the QPushButton for navigating to the previous task. |
menuButton | Pointer to the QToolButton for opening the sidebar. |
resetRobotStartButton | Pointer to the QToolButton for resetting the robot. |
resetRobotFrame | Pointer to the QFrame displaying the reset of the robot. |
centralWidget | Pointer to the central QWidget for the plugin. |
parent | Pointer to the parent QObject. |
◆ failedRobotResetUI()
void TaskUI::failedRobotResetUI |
( |
const QString & |
error | ) |
|
Update the UI to show that the robot reset has failed.
- Parameters
-
error | the error that occured while resetting the robot. |
◆ finishedRobotResetUI()
void TaskUI::finishedRobotResetUI |
( |
| ) |
|
Update the UI to show that the robot reset has finished.
◆ initializeUI()
void TaskUI::initializeUI |
( |
const QVector< QSharedPointer< Task >> & |
tasks | ) |
|
Initializes the UI with the loaded tasks.
- Parameters
-
tasks | Vector of loaded tasks. |
◆ setTaskManager()
◆ setTaskUI()
void TaskUI::setTaskUI |
( |
int |
currentTaskIndex, |
|
|
const QVector< QSharedPointer< Task >> & |
tasks |
|
) |
| |
Sets the UI elements for the current task.
- Parameters
-
currentTaskIndex | Index of the current task. |
tasks | Vector of tasks. |
◆ startedRobotResetUI()
void TaskUI::startedRobotResetUI |
( |
bool |
noSubtasksLeft | ) |
|
Update the UI to show that the robot reset has been started.
- Parameters
-
noSubtasksLeft | indicator, if subtasks are running after the rest or not. |
◆ taskSelected
void TaskUI::taskSelected |
( |
int |
index | ) |
|
|
signal |
Signal emitted when a task is selected.
- Parameters
-
index | Index of the selected task. |
◆ updateSubtaskItemsUI()
void TaskUI::updateSubtaskItemsUI |
( |
| ) |
|
Updates the UI elements for the subtasks.
The documentation for this class was generated from the following file: