Added basic functionality backend in C++
This commit is contained in:
@ -17,6 +17,8 @@ qt_add_qml_module(appProject-Orion
|
||||
VERSION 1.0
|
||||
QML_FILES
|
||||
Main.qml
|
||||
SOURCES user.h user.cpp
|
||||
SOURCES userlist.h userlist.cpp
|
||||
)
|
||||
|
||||
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
|
||||
|
@ -19,7 +19,5 @@ Window {
|
||||
text: qsTr("This view is currently empty :(")
|
||||
height: parent.height
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
5
src/Project-Orion/user.cpp
Normal file
5
src/Project-Orion/user.cpp
Normal file
@ -0,0 +1,5 @@
|
||||
#include "user.h"
|
||||
|
||||
User::User(QString name, QDate dateOfBirth, QDate dateOfDeath, bool isItDefault)
|
||||
: name{name}, dateOfBirth{dateOfBirth}, dateOfDeath{dateOfDeath}
|
||||
{}
|
17
src/Project-Orion/user.h
Normal file
17
src/Project-Orion/user.h
Normal file
@ -0,0 +1,17 @@
|
||||
#ifndef USER_H
|
||||
#define USER_H
|
||||
|
||||
#include <qdatetime.h>
|
||||
class User
|
||||
{
|
||||
public:
|
||||
User(QString name, QDate dateOfBirth, QDate dateOfDeath, bool isItDefault = false);
|
||||
|
||||
private:
|
||||
QString name;
|
||||
QDate dateOfBirth;
|
||||
QDate dateOfDeath;
|
||||
bool isItDefault = false;
|
||||
};
|
||||
|
||||
#endif // USER_H
|
13
src/Project-Orion/userlist.cpp
Normal file
13
src/Project-Orion/userlist.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
#include "userlist.h"
|
||||
|
||||
UserList::UserList() {}
|
||||
|
||||
QVector<User> UserList::getList() const
|
||||
{
|
||||
return list;
|
||||
}
|
||||
|
||||
void UserList::setList(const QVector<User> &newList)
|
||||
{
|
||||
list = newList;
|
||||
}
|
19
src/Project-Orion/userlist.h
Normal file
19
src/Project-Orion/userlist.h
Normal file
@ -0,0 +1,19 @@
|
||||
#ifndef USERLIST_H
|
||||
#define USERLIST_H
|
||||
|
||||
#include <QObject>
|
||||
#include "user.h"
|
||||
|
||||
class UserList
|
||||
{
|
||||
public:
|
||||
UserList();
|
||||
|
||||
QVector<User> getList() const;
|
||||
void setList(const QVector<User> &newList);
|
||||
|
||||
private:
|
||||
QVector<User> list;
|
||||
};
|
||||
|
||||
#endif // USERLIST_H
|
Reference in New Issue
Block a user