Learn Environment
Loading...
Searching...
No Matches
include
learn_environment
sidebar.hpp
Go to the documentation of this file.
1
#ifndef SIDEBAR_HPP
2
#define SIDEBAR_HPP
3
4
#include "
custom_list_widget.hpp
"
5
#include "
task.hpp
"
6
7
#include <QWidget>
8
#include <QVBoxLayout>
9
#include <QLabel>
10
#include <QMap>
11
#include <QListWidget>
12
#include <QSharedPointer>
13
22
class
Sidebar
:
public
QWidget
23
{
24
Q_OBJECT
25
26
public
:
31
explicit
Sidebar
(
QWidget
*parent =
nullptr
);
32
37
void
fillSidebarWithTasks
(
const
QVector<QSharedPointer<Task>>& tasks);
38
43
void
selectTask
(
int
index);
44
45
Q_SIGNALS:
50
void
taskSelected
(
int
index);
51
52
private
Q_SLOTS:
57
void
onTaskItemClicked(QListWidgetItem *item);
58
59
private
:
64
CustomListWidget
* createList();
65
66
CustomListWidget
*listWidget;
67
QMap<int, QListWidgetItem*> taskIndexToItemMap;
68
};
69
70
#endif
// SIDEBAR_HPP
CustomListWidget
A custom QListWidget with enhanced mouse interaction.
Definition
custom_list_widget.hpp:16
QWidget
Sidebar
Represents the sidebar UI component for displaying tasks.
Definition
sidebar.hpp:23
Sidebar::Sidebar
Sidebar(QWidget *parent=nullptr)
Constructs a Sidebar object.
Definition
sidebar.cpp:38
Sidebar::selectTask
void selectTask(int index)
Selects a task in the sidebar by its index.
Definition
sidebar.cpp:114
Sidebar::fillSidebarWithTasks
void fillSidebarWithTasks(const QVector< QSharedPointer< Task > > &tasks)
Populates the sidebar with tasks.
Definition
sidebar.cpp:64
Sidebar::taskSelected
void taskSelected(int index)
Signal emitted when a task is selected.
custom_list_widget.hpp
task.hpp
Generated by
1.12.0