feat: add login ui

This commit is contained in:
kuchy 2022-04-03 20:15:51 +02:00
parent f909fecb68
commit 28aa80797f
14 changed files with 221 additions and 23 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-VYhRpE/clang-uiheader-GTTwCV",
"/tmp/QtCreator-rbvfPi/clang-uiheader-UnlsmF",
"-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-VYhRpE/clang-uiheader-GTTwCV",
"/tmp/QtCreator-rbvfPi/clang-uiheader-UnlsmF",
"-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-VYhRpE/clang-uiheader-GTTwCV",
"/tmp/QtCreator-rbvfPi/clang-uiheader-UnlsmF",
"-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-VYhRpE/clang-uiheader-GTTwCV",
"/tmp/QtCreator-rbvfPi/clang-uiheader-UnlsmF",
"-nostdinc",
"-nostdinc++",
"-pipe",
@ -274,5 +274,74 @@
],
"directory": "/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/egui_lab1_krzysztof_rudnicki/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/.qtc_clangd",
"file": "/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/egui_lab1_krzysztof_rudnicki/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/ui_mainwindow.h"
},
{
"arguments": [
"clang",
"-I",
"/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/QT/Tools/QtCreator/share/qtcreator/cplusplus/wrappedQtHeaders",
"-I",
"/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/QT/Tools/QtCreator/share/qtcreator/cplusplus/wrappedQtHeaders/QtCore",
"-I",
"/tmp/QtCreator-rbvfPi/clang-uiheader-UnlsmF",
"-nostdinc",
"-nostdinc++",
"-pipe",
"-g",
"-std=gnu++1z",
"-Wall",
"-Wextra",
"-D_REENTRANT",
"-fPIC",
"-fsyntax-only",
"-m64",
"--target=x86_64-linux-gnu",
"-DQ_CREATOR_RUN",
"-DQT_QML_DEBUG",
"-DQT_WIDGETS_LIB",
"-DQT_GUI_LIB",
"-DQT_CORE_LIB",
"-I",
"/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/egui_lab1_krzysztof_rudnicki/lab1",
"-I",
"/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/QT/6.2.4/gcc_64/include",
"-I",
"/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/QT/6.2.4/gcc_64/include/QtWidgets",
"-I",
"/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/QT/6.2.4/gcc_64/include/QtGui",
"-I",
"/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/QT/6.2.4/gcc_64/include/QtCore",
"-I",
"/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/egui_lab1_krzysztof_rudnicki/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug",
"-I",
"/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/QT/6.2.4/gcc_64/mkspecs/linux-g++",
"-isystem",
"/usr/include/c++/9",
"-isystem",
"/usr/include/x86_64-linux-gnu/c++/9",
"-isystem",
"/usr/include/c++/9/backward",
"-isystem",
"/usr/local/include",
"-isystem",
"/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/QT/Tools/QtCreator/libexec/qtcreator/clang/lib/clang/14.0.0/include",
"-isystem",
"/usr/include/x86_64-linux-gnu",
"-isystem",
"/usr/include",
"-fmessage-length=0",
"-fdiagnostics-show-note-include-stack",
"-fretain-comments-from-system-headers",
"-fmacro-backtrace-limit=0",
"-ferror-limit=1000",
"-x",
"c++-header",
"-Wno-unknown-pragmas",
"-Wno-unknown-warning-option",
"-Wno-documentation-unknown-command",
"/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/egui_lab1_krzysztof_rudnicki/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/ui_login.h"
],
"directory": "/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/egui_lab1_krzysztof_rudnicki/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/.qtc_clangd",
"file": "/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/egui_lab1_krzysztof_rudnicki/build-lab1-Desktop_Qt_6_2_4_GCC_64bit-Debug/ui_login.h"
}
]

View File

@ -208,7 +208,7 @@ TARGET = lab1
first: all
####### Build rules
lab1: ui_mainwindow.h $(OBJECTS)
lab1: ui_login.h ui_mainwindow.h $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
Makefile: ../lab1/lab1.pro ../../QT/6.2.4/gcc_64/mkspecs/linux-g++/qmake.conf ../../QT/6.2.4/gcc_64/mkspecs/features/spec_pre.prf \
@ -519,7 +519,7 @@ distdir: FORCE
$(COPY_FILE) --parents ../../QT/6.2.4/gcc_64/mkspecs/features/data/dummy.cpp $(DISTDIR)/
$(COPY_FILE) --parents ../lab1/mainwindow.h $(DISTDIR)/
$(COPY_FILE) --parents ../lab1/main.cpp ../lab1/mainwindow.cpp $(DISTDIR)/
$(COPY_FILE) --parents ../lab1/mainwindow.ui $(DISTDIR)/
$(COPY_FILE) --parents ../lab1/login.ui ../lab1/mainwindow.ui $(DISTDIR)/
$(COPY_FILE) --parents ../lab1/lab1_pl_PL.ts $(DISTDIR)/
@ -715,9 +715,13 @@ compiler_moc_objc_header_make_all:
compiler_moc_objc_header_clean:
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all: ui_mainwindow.h
compiler_uic_make_all: ui_login.h ui_mainwindow.h
compiler_uic_clean:
-$(DEL_FILE) ui_mainwindow.h
-$(DEL_FILE) ui_login.h ui_mainwindow.h
ui_login.h: ../lab1/login.ui \
../../QT/6.2.4/gcc_64/libexec/uic
/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/QT/6.2.4/gcc_64/libexec/uic ../lab1/login.ui -o ui_login.h
ui_mainwindow.h: ../lab1/mainwindow.ui \
../../QT/6.2.4/gcc_64/libexec/uic
/home/kuchy/Zlew/Studia/NieNotatki/Projekty/nie_inzynierka/Programowanie/EGUI/QT/6.2.4/gcc_64/libexec/uic ../lab1/mainwindow.ui -o ui_mainwindow.h

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[18];
char stringdata0[116];
const uint offsetsAndSize[24];
char stringdata0[163];
};
#define QT_MOC_LITERAL(ofs, len) \
uint(offsetof(qt_meta_stringdata_MainWindow_t, stringdata0) + ofs), len
@ -37,13 +37,17 @@ 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"
QT_MOC_LITERAL(102, 13) // "thisIdIsTaken"
QT_MOC_LITERAL(102, 13), // "thisIdIsTaken"
QT_MOC_LITERAL(116, 13), // "thisIdIsEmpty"
QT_MOC_LITERAL(130, 22), // "on_loginButton_clicked"
QT_MOC_LITERAL(153, 9) // "goToLogin"
},
"MainWindow\0saveRegisteredUser\0\0"
"QJsonObject&\0users\0on_pushButton_clicked\0"
"saveJsonFile\0readUserJsonFile\0"
"thisIdIsTaken"
"thisIdIsTaken\0thisIdIsEmpty\0"
"on_loginButton_clicked\0goToLogin"
};
#undef QT_MOC_LITERAL
@ -53,7 +57,7 @@ static const uint qt_meta_data_MainWindow[] = {
10, // revision
0, // classname
0, 0, // classinfo
5, 14, // methods
8, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
@ -61,11 +65,14 @@ static const uint qt_meta_data_MainWindow[] = {
0, // signalCount
// slots: name, argc, parameters, tag, flags, initial metatype offsets
1, 1, 44, 2, 0x108, 1 /* Private | MethodIsConst */,
5, 0, 47, 2, 0x08, 3 /* Private */,
6, 1, 48, 2, 0x108, 4 /* Private | MethodIsConst */,
7, 0, 51, 2, 0x08, 6 /* Private */,
8, 0, 52, 2, 0x108, 7 /* Private | MethodIsConst */,
1, 1, 62, 2, 0x108, 1 /* Private | MethodIsConst */,
5, 0, 65, 2, 0x08, 3 /* Private */,
6, 1, 66, 2, 0x108, 4 /* Private | MethodIsConst */,
7, 0, 69, 2, 0x08, 6 /* Private */,
8, 0, 70, 2, 0x108, 7 /* Private | MethodIsConst */,
9, 0, 71, 2, 0x108, 8 /* Private | MethodIsConst */,
10, 0, 72, 2, 0x08, 9 /* Private */,
11, 0, 73, 2, 0x08, 10 /* Private */,
// slots: parameters
QMetaType::Void, 0x80000000 | 3, 4,
@ -73,6 +80,9 @@ static const uint qt_meta_data_MainWindow[] = {
QMetaType::Void, 0x80000000 | 3, 4,
QMetaType::QJsonObject,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Bool,
0 // eod
};
@ -89,6 +99,10 @@ void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id,
case 3: { QJsonObject _r = _t->readUserJsonFile();
if (_a[0]) *reinterpret_cast< QJsonObject*>(_a[0]) = std::move(_r); } break;
case 4: _t->thisIdIsTaken(); break;
case 5: _t->thisIdIsEmpty(); break;
case 6: _t->on_loginButton_clicked(); break;
case 7: { bool _r = _t->goToLogin();
if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = std::move(_r); } break;
default: ;
}
}
@ -102,7 +116,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<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<void, std::false_type>, QtPrivate::TypeAndForceComplete<QJsonObject &, std::false_type>, QtPrivate::TypeAndForceComplete<QJsonObject, std::false_type>, QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<bool, std::false_type>
>,
@ -129,13 +143,13 @@ int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 5)
if (_id < 8)
qt_static_metacall(this, _c, _id, _a);
_id -= 5;
_id -= 8;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 5)
if (_id < 8)
*reinterpret_cast<QMetaType *>(_a[0]) = QMetaType();
_id -= 5;
_id -= 8;
}
return _id;
}

View File

@ -0,0 +1,94 @@
/********************************************************************************
** Form generated from reading UI file 'login.ui'
**
** Created by: Qt User Interface Compiler version 6.2.4
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_LOGIN_H
#define UI_LOGIN_H
#include <QtCore/QVariant>
#include <QtWidgets/QApplication>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_Form
{
public:
QVBoxLayout *verticalLayout;
QLabel *label;
QLabel *label_2;
QLineEdit *lineEdit;
QLabel *label_4;
QLineEdit *loginPassword;
QPushButton *pushButton;
void setupUi(QWidget *Form)
{
if (Form->objectName().isEmpty())
Form->setObjectName(QString::fromUtf8("Form"));
Form->resize(436, 333);
verticalLayout = new QVBoxLayout(Form);
verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
label = new QLabel(Form);
label->setObjectName(QString::fromUtf8("label"));
verticalLayout->addWidget(label);
label_2 = new QLabel(Form);
label_2->setObjectName(QString::fromUtf8("label_2"));
verticalLayout->addWidget(label_2);
lineEdit = new QLineEdit(Form);
lineEdit->setObjectName(QString::fromUtf8("lineEdit"));
verticalLayout->addWidget(lineEdit);
label_4 = new QLabel(Form);
label_4->setObjectName(QString::fromUtf8("label_4"));
verticalLayout->addWidget(label_4);
loginPassword = new QLineEdit(Form);
loginPassword->setObjectName(QString::fromUtf8("loginPassword"));
loginPassword->setEchoMode(QLineEdit::Password);
verticalLayout->addWidget(loginPassword);
pushButton = new QPushButton(Form);
pushButton->setObjectName(QString::fromUtf8("pushButton"));
verticalLayout->addWidget(pushButton);
retranslateUi(Form);
QMetaObject::connectSlotsByName(Form);
} // setupUi
void retranslateUi(QWidget *Form)
{
Form->setWindowTitle(QCoreApplication::translate("Form", "Form", nullptr));
label->setText(QCoreApplication::translate("Form", "<html><head/><body><p align=\"center\"><span style=\" font-size:72pt;\">Login</span></p></body></html>", nullptr));
label_2->setText(QCoreApplication::translate("Form", "<html><head/><body><p align=\"center\"><span style=\" font-size:36pt;\">ID</span></p></body></html>", nullptr));
label_4->setText(QCoreApplication::translate("Form", "<html><head/><body><p align=\"center\"><span style=\" font-size:36pt;\">Password</span></p></body></html>", nullptr));
pushButton->setText(QCoreApplication::translate("Form", "Login", nullptr));
} // retranslateUi
};
namespace Ui {
class Form: public Ui_Form {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_LOGIN_H

View File

@ -34,6 +34,7 @@ public:
QPushButton *pushButton;
QLabel *label_2;
QLabel *label_4;
QPushButton *loginButton;
QMenuBar *menubar;
void setupUi(QMainWindow *MainWindow)
@ -86,6 +87,11 @@ public:
formLayout->setWidget(2, QFormLayout::SpanningRole, label_4);
loginButton = new QPushButton(centralwidget);
loginButton->setObjectName(QString::fromUtf8("loginButton"));
formLayout->setWidget(9, QFormLayout::SpanningRole, loginButton);
MainWindow->setCentralWidget(centralwidget);
menubar = new QMenuBar(MainWindow);
menubar->setObjectName(QString::fromUtf8("menubar"));
@ -121,6 +127,7 @@ public:
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));
loginButton->setText(QCoreApplication::translate("MainWindow", "Already Registered? Click here to Login!", nullptr));
} // retranslateUi
};

View File

@ -1,7 +1,17 @@
{
"": {
"id": "",
"mail": "",
"password": ""
},
"1": {
"id": "1",
"mail": "1",
"password": "SupertajnehasloxDDDDD"
},
"2": {
"id": "2",
"mail": "",
"password": ""
}
}