|
|
@ -1,56 +1,56 @@
|
|
|
|
#include "tagdata.h"
|
|
|
|
#include "tagdata.h" // 包含TagData类的头文件
|
|
|
|
|
|
|
|
|
|
|
|
TagData::TagData()
|
|
|
|
TagData::TagData()// TagData类的构造函数
|
|
|
|
: m_id{ SpecialTagID::InvalidTagId }, m_relativePosition{ -1 }, m_childNotesCount{ 0 }
|
|
|
|
: m_id{ SpecialTagID::InvalidTagId }, m_relativePosition{ -1 }, m_childNotesCount{ 0 }
|
|
|
|
{
|
|
|
|
{ // 初始化标签ID为无效值,相对位置为-1,子笔记数量为0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int TagData::id() const
|
|
|
|
int TagData::id() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return m_id;
|
|
|
|
return m_id;// 返回标签ID
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TagData::setId(int newId)
|
|
|
|
void TagData::setId(int newId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_id = newId;
|
|
|
|
m_id = newId;// 设置新的标签ID
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const QString &TagData::name() const
|
|
|
|
const QString &TagData::name() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return m_name;
|
|
|
|
return m_name; // 返回标签名称
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TagData::setName(const QString &newName)
|
|
|
|
void TagData::setName(const QString &newName)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_name = newName;
|
|
|
|
m_name = newName; // 设置新的标签名称
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const QString &TagData::color() const
|
|
|
|
const QString &TagData::color() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return m_color;
|
|
|
|
return m_color;// 返回标签颜色
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TagData::setColor(const QString &newColor)
|
|
|
|
void TagData::setColor(const QString &newColor)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_color = newColor;
|
|
|
|
m_color = newColor;// 设置新的标签颜色
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int TagData::relativePosition() const
|
|
|
|
int TagData::relativePosition() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return m_relativePosition;
|
|
|
|
return m_relativePosition;// 返回标签的相对位置
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TagData::setRelativePosition(int newRelativePosition)
|
|
|
|
void TagData::setRelativePosition(int newRelativePosition)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_relativePosition = newRelativePosition;
|
|
|
|
m_relativePosition = newRelativePosition; // 设置新的标签相对位置
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int TagData::childNotesCount() const
|
|
|
|
int TagData::childNotesCount() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return m_childNotesCount;
|
|
|
|
return m_childNotesCount;// 返回标签下的子笔记数量
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TagData::setChildNotesCount(int newChildCount)
|
|
|
|
void TagData::setChildNotesCount(int newChildCount)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_childNotesCount = newChildCount;
|
|
|
|
m_childNotesCount = newChildCount; // 设置新的子笔记数量
|
|
|
|
}
|
|
|
|
}
|
|
|
|