mirror of
https://github.com/tnodir/fort
synced 2024-11-16 11:26:30 +00:00
40 lines
631 B
C++
40 lines
631 B
C++
|
#include "addressgroup.h"
|
||
|
|
||
|
AddressGroup::AddressGroup(QObject *parent) :
|
||
|
QObject(parent),
|
||
|
m_useAll(false)
|
||
|
{
|
||
|
}
|
||
|
|
||
|
void AddressGroup::setUseAll(bool useAll)
|
||
|
{
|
||
|
if (m_useAll != useAll) {
|
||
|
m_useAll = useAll;
|
||
|
emit useAllChanged();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void AddressGroup::setText(const QString &text)
|
||
|
{
|
||
|
if (m_text != text) {
|
||
|
m_text = text;
|
||
|
emit textChanged();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
QVariant AddressGroup::toVariant() const
|
||
|
{
|
||
|
QVariantMap map;
|
||
|
|
||
|
map["text"] = text();
|
||
|
|
||
|
return map;
|
||
|
}
|
||
|
|
||
|
void AddressGroup::fromVariant(const QVariant &v)
|
||
|
{
|
||
|
QVariantMap map = v.toMap();
|
||
|
|
||
|
m_text = map["text"].toString();
|
||
|
}
|