File indexing completed on 2024-03-24 05:57:15
0001 // SPDX-FileCopyrightText: 2022 Felipe Kinoshita <kinofhek@gmail.com> 0002 // SPDX-License-Identifier: LGPL-2.1-or-later 0003 0004 #pragma once 0005 0006 #include <QJsonObject> 0007 #include <QString> 0008 0009 class Task 0010 { 0011 public: 0012 explicit Task(const QString &title, bool checked); 0013 0014 [[nodiscard]] QString title() const; 0015 [[nodiscard]] bool checked() const; 0016 0017 void setTitle(const QString &title); 0018 void setChecked(const bool &checked); 0019 0020 static Task fromJson(const QJsonObject &obj); 0021 [[nodiscard]] QJsonObject toJson() const; 0022 0023 private: 0024 QString m_title; 0025 bool m_checked; 0026 };