Record class created1

This commit is contained in:
Daniil 2021-12-02 19:56:01 +03:00
parent 283eac9ad5
commit 0878f6005d
5 changed files with 113 additions and 0 deletions

View File

@ -22,6 +22,8 @@ set(PROJECT_SOURCES
mainwindow.ui mainwindow.ui
manager.h manager.h
manager.cpp manager.cpp
record.h
record.cpp
) )
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6) if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)

View File

@ -4,3 +4,10 @@ Manager::Manager()
{ {
} }
void Manager::init(){}
Record* Manager::get(){
return nullptr;
}
void Manager::put(){}
void Manager::update(){}

View File

@ -3,11 +3,18 @@
#include <QtSql> #include <QtSql>
#include "record.h"
class Manager class Manager
{ {
public: public:
Manager(); Manager();
void init();
Record* get();
void put();
void update();
private: private:

View File

@ -0,0 +1,58 @@
#include "record.h"
Record::Record()
{
}
Record::Record(QString name,
QString username,
QString URL,
QString note,
QDateTime time){
this->name = name;
this->username = username;
this->URL = URL;
this->note = note;
this->time = time;
}
Record::Record(QString name,
QString username,
QString URL,
QDateTime time){
this->name = name;
this->username = username;
this->URL = URL;
this->time = time;
}
QString Record::getName(){
return name;
}
QString Record::getUsername(){
return username;
}
QString Record::getURL(){
return URL;
}
QString Record::getNote(){
return note;
}
QDateTime Record::getTime(){
return time;
}
void Record::setName(QString name){
this->name = name;
}
void Record::setUsername(QString username){
this->username = username;
}
void Record::setURL(QString URL){
this->URL = URL;
}
void Record::setNote(QString note){
this->note = note;
}
void Record::setTime(QDateTime time){
this->time = time;
}

39
PasswordManager/record.h Normal file
View File

@ -0,0 +1,39 @@
#ifndef RECORD_H
#define RECORD_H
#include <QString>
#include <QDateTime>
class Record
{
public:
Record();
Record(QString name,
QString username,
QString URL,
QString note,
QDateTime time);
Record(QString name,
QString username,
QString URL,
QDateTime time);
QString getName();
QString getUsername();
QString getURL();
QString getNote();
QDateTime getTime();
void setName();
void setUsername();
void setURL();
void setNote();
void setTime();
private:
QString name;
QString username;
QString URL;
QString note;
QDateTime time;
};
#endif // RECORD_H