-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasksloader.h
50 lines (35 loc) · 1.17 KB
/
tasksloader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef TASKSLOADER_H
#define TASKSLOADER_H
#include <QObject>
#include <qqml.h>
#include <QList>
#include <iostream>
#include <map>
class TasksLoader : public QObject
{
Q_OBJECT
Q_PROPERTY(QList<QString> tasksList READ tasksList WRITE setTasksList NOTIFY tasksListChanged)
Q_PROPERTY(int temperature READ temperature WRITE setTemperature NOTIFY temperatureChanged)
Q_PROPERTY(QString weatherStatus READ weatherStatus WRITE setWeatherStatus NOTIFY weatherStatusChanged)
QML_ELEMENT
public:
explicit TasksLoader(QObject *parent = nullptr);
void loadDataFile();
Q_INVOKABLE QList<QString> getSuitableTasksWithWeather();
void addTaskToTasksList(QString taskName);
QList<QString> tasksList() const;
void setTasksList(QList<QString> newTasksList);
int temperature() const;
void setTemperature(int newTemperature);
QString weatherStatus() const;
void setWeatherStatus(const QString &newWeatherStatus);
signals:
void tasksListChanged();
void temperatureChanged();
void weatherStatusChanged();
private:
QList<QString> m_tasksList;
int m_temperature;
QString m_weatherStatus;
};
#endif // TASKSLOADER_H