update// added new model derived from chatmodel and contactmodel, moved listchatdelegate to a seperated class file

This commit is contained in:
Strider
2020-05-09 17:55:12 +02:00
parent 3a155101de
commit 0f57412258
13 changed files with 454 additions and 373 deletions

66
src/Model/ContactItem.cpp Normal file
View File

@@ -0,0 +1,66 @@
#include "ContactItem.h"
ContactItem::ContactItem() {}
ContactItem::ContactItem(QString name, QString partnerAddress, QString myAddress, QString cid, QString avatar)
{
_name = name;
_myAddress = myAddress;
_partnerAddress = partnerAddress;
_cid = cid;
_avatar = avatar;
}
QString ContactItem::getName() const
{
return _name;
}
QString ContactItem::getMyAddress() const
{
return _myAddress;
}
QString ContactItem::getPartnerAddress() const
{
return _partnerAddress;
}
QString ContactItem::getCid() const
{
return _cid;
}
QString ContactItem::getAvatar() const
{
return _avatar;
}
void ContactItem::setName(QString name)
{
_name = name;
}
void ContactItem::setMyAddress(QString myAddress)
{
_myAddress = myAddress;
}
void ContactItem::setPartnerAddress(QString partnerAddress)
{
_partnerAddress = partnerAddress;
}
void ContactItem::setcid(QString cid)
{
_cid = cid;
}
void ContactItem::setAvatar(QString avatar)
{
_avatar = avatar;
}
QString ContactItem::toQTString()
{
return _name + "|" + _partnerAddress + "|" + _myAddress + "|" + _cid + "|" + _avatar;
}