Learn Environment
include
ui
sidebar.hpp
Go to the documentation of this file.
1
#ifndef SIDEBAR_HPP
2
#define SIDEBAR_HPP
3
4
#include "
ui/custom_list_widget.hpp
"
5
#include "
common/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
Sidebar::Sidebar
Sidebar(QWidget *parent=nullptr)
Constructs a Sidebar object.
Definition:
sidebar.cpp:38
task.hpp
Sidebar
Represents the sidebar UI component for displaying tasks.
Definition:
sidebar.hpp:22
Sidebar::selectTask
void selectTask(int index)
Selects a task in the sidebar by its index.
Definition:
sidebar.cpp:114
QWidget
sidebar.hpp
Sidebar::taskSelected
void taskSelected(int index)
Signal emitted when a task is selected.
Sidebar::fillSidebarWithTasks
void fillSidebarWithTasks(const QVector< QSharedPointer< Task >> &tasks)
Populates the sidebar with tasks.
Definition:
sidebar.cpp:64
custom_list_widget.hpp
CustomListWidget
A custom QListWidget with enhanced mouse interaction.
Definition:
custom_list_widget.hpp:16
Generated by
1.8.17