feat: store user data seperate jsons

This commit is contained in:
kuchy 2022-04-02 13:28:23 +02:00
parent ee504a485c
commit 4dc5703540
60 changed files with 78 additions and 47 deletions

View File

@ -7,7 +7,7 @@
"-I",
"/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/QT/Tools/QtCreator/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-AiUkSY/clang-uiheader-vVWDiY",
"/tmp/QtCreator-VYhRpE/clang-uiheader-GTTwCV",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -76,7 +76,7 @@
"-I",
"/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/QT/Tools/QtCreator/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-AiUkSY/clang-uiheader-vVWDiY",
"/tmp/QtCreator-VYhRpE/clang-uiheader-GTTwCV",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -145,7 +145,7 @@
"-I",
"/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/QT/Tools/QtCreator/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-AiUkSY/clang-uiheader-vVWDiY",
"/tmp/QtCreator-VYhRpE/clang-uiheader-GTTwCV",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -214,7 +214,7 @@
"-I",
"/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/QT/Tools/QtCreator/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-AiUkSY/clang-uiheader-vVWDiY",
"/tmp/QtCreator-VYhRpE/clang-uiheader-GTTwCV",
"-nostdinc",
"-nostdinc++",
"-pipe",

View File

@ -22,8 +22,8 @@ QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_MainWindow_t {
const uint offsetsAndSize[14];
char stringdata0[84];
const uint offsetsAndSize[16];
char stringdata0[102];
};
#define QT_MOC_LITERAL(ofs, len) \
uint(offsetof(qt_meta_stringdata_MainWindow_t, stringdata0) + ofs), len
@ -33,14 +33,15 @@ QT_MOC_LITERAL(0, 10), // "MainWindow"
QT_MOC_LITERAL(11, 18), // "saveRegisteredUser"
QT_MOC_LITERAL(30, 0), // ""
QT_MOC_LITERAL(31, 12), // "QJsonObject&"
QT_MOC_LITERAL(44, 4), // "json"
QT_MOC_LITERAL(49, 21), // "on_pushButton_clicked"
QT_MOC_LITERAL(71, 12) // "saveJsonFile"
QT_MOC_LITERAL(44, 5), // "users"
QT_MOC_LITERAL(50, 21), // "on_pushButton_clicked"
QT_MOC_LITERAL(72, 12), // "saveJsonFile"
QT_MOC_LITERAL(85, 16) // "readUserJsonFile"
},
"MainWindow\0saveRegisteredUser\0\0"
"QJsonObject&\0json\0on_pushButton_clicked\0"
"saveJsonFile"
"QJsonObject&\0users\0on_pushButton_clicked\0"
"saveJsonFile\0readUserJsonFile"
};
#undef QT_MOC_LITERAL
@ -50,7 +51,7 @@ static const uint qt_meta_data_MainWindow[] = {
10, // revision
0, // classname
0, 0, // classinfo
3, 14, // methods
4, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
@ -58,14 +59,16 @@ static const uint qt_meta_data_MainWindow[] = {
0, // signalCount
// slots: name, argc, parameters, tag, flags, initial metatype offsets
1, 1, 32, 2, 0x108, 1 /* Private | MethodIsConst */,
5, 0, 35, 2, 0x08, 3 /* Private */,
6, 1, 36, 2, 0x108, 4 /* Private | MethodIsConst */,
1, 1, 38, 2, 0x108, 1 /* Private | MethodIsConst */,
5, 0, 41, 2, 0x08, 3 /* Private */,
6, 1, 42, 2, 0x108, 4 /* Private | MethodIsConst */,
7, 0, 45, 2, 0x08, 6 /* Private */,
// slots: parameters
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::Void,
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::QJsonObject,
0 // eod
};
@ -79,6 +82,8 @@ void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id,
case 0: _t->saveRegisteredUser((*reinterpret_cast< std::add_pointer_t<QJsonObject&>>(_a[1]))); break;
case 1: _t->on_pushButton_clicked(); break;
case 2: _t->saveJsonFile((*reinterpret_cast< std::add_pointer_t<QJsonObject&>>(_a[1]))); break;
case 3: { QJsonObject _r = _t->readUserJsonFile();
if (_a[0]) *reinterpret_cast< QJsonObject*>(_a[0]) = std::move(_r); } break;
default: ;
}
}
@ -92,7 +97,7 @@ const QMetaObject MainWindow::staticMetaObject = { {
nullptr,
qt_incomplete_metaTypeArray<qt_meta_stringdata_MainWindow_t
, QtPrivate::TypeAndForceComplete<MainWindow, std::true_type>
, QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<QJsonObject &, std::false_type>, QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<QJsonObject &, std::false_type>
, QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<QJsonObject &, std::false_type>, QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<QJsonObject &, std::false_type>, QtPrivate::TypeAndForceComplete<QJsonObject, std::false_type>
>,
@ -119,13 +124,13 @@ int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 3)
if (_id < 4)
qt_static_metacall(this, _c, _id, _a);
_id -= 3;
_id -= 4;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 3)
if (_id < 4)
*reinterpret_cast<QMetaType *>(_a[0]) = QMetaType();
_id -= 3;
_id -= 4;
}
return _id;
}

View File

@ -1,4 +0,0 @@
{
"mail": "33",
"password": "3"
}

View File

@ -27,11 +27,13 @@ public:
QWidget *centralwidget;
QFormLayout *formLayout;
QLabel *label;
QLabel *label_2;
QLabel *label_3;
QPushButton *pushButton;
QLineEdit *inputId;
QLineEdit *inputMail;
QLabel *label_3;
QLineEdit *inputPassword;
QPushButton *pushButton;
QLabel *label_2;
QLabel *label_4;
QMenuBar *menubar;
void setupUi(QMainWindow *MainWindow)
@ -48,30 +50,40 @@ public:
formLayout->setWidget(0, QFormLayout::SpanningRole, label);
label_2 = new QLabel(centralwidget);
label_2->setObjectName(QString::fromUtf8("label_2"));
inputId = new QLineEdit(centralwidget);
inputId->setObjectName(QString::fromUtf8("inputId"));
formLayout->setWidget(1, QFormLayout::SpanningRole, label_2);
label_3 = new QLabel(centralwidget);
label_3->setObjectName(QString::fromUtf8("label_3"));
formLayout->setWidget(3, QFormLayout::SpanningRole, label_3);
pushButton = new QPushButton(centralwidget);
pushButton->setObjectName(QString::fromUtf8("pushButton"));
formLayout->setWidget(5, QFormLayout::SpanningRole, pushButton);
formLayout->setWidget(3, QFormLayout::SpanningRole, inputId);
inputMail = new QLineEdit(centralwidget);
inputMail->setObjectName(QString::fromUtf8("inputMail"));
formLayout->setWidget(2, QFormLayout::SpanningRole, inputMail);
formLayout->setWidget(5, QFormLayout::SpanningRole, inputMail);
label_3 = new QLabel(centralwidget);
label_3->setObjectName(QString::fromUtf8("label_3"));
formLayout->setWidget(6, QFormLayout::SpanningRole, label_3);
inputPassword = new QLineEdit(centralwidget);
inputPassword->setObjectName(QString::fromUtf8("inputPassword"));
formLayout->setWidget(4, QFormLayout::SpanningRole, inputPassword);
formLayout->setWidget(7, QFormLayout::SpanningRole, inputPassword);
pushButton = new QPushButton(centralwidget);
pushButton->setObjectName(QString::fromUtf8("pushButton"));
formLayout->setWidget(8, QFormLayout::SpanningRole, pushButton);
label_2 = new QLabel(centralwidget);
label_2->setObjectName(QString::fromUtf8("label_2"));
formLayout->setWidget(4, QFormLayout::SpanningRole, label_2);
label_4 = new QLabel(centralwidget);
label_4->setObjectName(QString::fromUtf8("label_4"));
formLayout->setWidget(2, QFormLayout::SpanningRole, label_4);
MainWindow->setCentralWidget(centralwidget);
menubar = new QMenuBar(MainWindow);
@ -88,12 +100,7 @@ public:
{
MainWindow->setWindowTitle(QCoreApplication::translate("MainWindow", "MainWindow", nullptr));
label->setText(QCoreApplication::translate("MainWindow", "<html><head/><body><p align=\"center\"><span style=\" font-size:72pt;\">Register</span></p></body></html>", nullptr));
label_2->setText(QCoreApplication::translate("MainWindow", "<html><head/><body><p align=\"center\"><span style=\" font-size:36pt;\">Mail</span></p></body></html>", nullptr));
label_3->setText(QCoreApplication::translate("MainWindow", "<html><head/><body><p align=\"center\"><span style=\" font-size:36pt;\">Password</span></p></body></html>", nullptr));
#if QT_CONFIG(tooltip)
pushButton->setToolTip(QCoreApplication::translate("MainWindow", "<html><head/><body><p><span style=\" font-size:72pt;\">Register</span></p><p><br/></p></body></html>", nullptr));
#endif // QT_CONFIG(tooltip)
pushButton->setText(QCoreApplication::translate("MainWindow", "Register", nullptr));
#if QT_CONFIG(tooltip)
inputPassword->setToolTip(QCoreApplication::translate("MainWindow", "Dupa\n"
"", nullptr));
@ -102,6 +109,12 @@ public:
inputPassword->setWhatsThis(QCoreApplication::translate("MainWindow", "<html><head/><body><p><br/></p></body></html>", nullptr));
#endif // QT_CONFIG(whatsthis)
inputPassword->setText(QString());
#if QT_CONFIG(tooltip)
pushButton->setToolTip(QCoreApplication::translate("MainWindow", "<html><head/><body><p><span style=\" font-size:72pt;\">Register</span></p><p><br/></p></body></html>", nullptr));
#endif // QT_CONFIG(tooltip)
pushButton->setText(QCoreApplication::translate("MainWindow", "Register", nullptr));
label_2->setText(QCoreApplication::translate("MainWindow", "<html><head/><body><p align=\"center\"><span style=\" font-size:36pt;\">Mail</span></p></body></html>", nullptr));
label_4->setText(QCoreApplication::translate("MainWindow", "<html><head/><body><p align=\"center\"><span style=\" font-size:36pt;\">ID</span></p></body></html>", nullptr));
} // retranslateUi
};

View File

@ -0,0 +1,17 @@
{
"3": {
"id": "3",
"mail": "3",
"password": "3"
},
"5": {
"id": "5",
"mail": "3",
"password": "3"
},
"id": {
"id": "2",
"mail": "1",
"password": "1"
}
}