WUT_Computer_Science/EGUI/lab1/blogentry.h

36 lines
663 B
C
Raw Normal View History

2022-04-04 21:22:50 +02:00
#ifndef BLOGENTRY_H
#define BLOGENTRY_H
#include <QWidget>
2022-04-05 00:26:36 +02:00
#include <QJsonObject>
#include <QFile>
#include <QJsonDocument>
2022-04-04 21:22:50 +02:00
namespace Ui {
class blogEntry;
}
class blogEntry : public QWidget
{
Q_OBJECT
public:
explicit blogEntry(QWidget *parent = nullptr);
~blogEntry();
2022-04-05 00:26:36 +02:00
void setUserId(const QString &userId);
2022-04-06 01:06:01 +02:00
void setBlogId(const QString &blogId);
2022-04-04 21:22:50 +02:00
2022-04-05 00:26:36 +02:00
private slots:
void on_saveEntry_clicked();
void saveEntry();
QJsonObject readJsonFile(const QString title);
void saveJsonFile(QJsonObject &users, const QString name) const;
2022-04-06 01:06:01 +02:00
2022-04-04 21:22:50 +02:00
private:
Ui::blogEntry *ui;
2022-04-05 00:26:36 +02:00
QString userId;
2022-04-06 01:06:01 +02:00
QString blogId;
2022-04-04 21:22:50 +02:00
};
#endif // BLOGENTRY_H