123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- #include "knowledgegraphwidgetitem.h"
- KnowledgeGraphWidgetItem::KnowledgeGraphWidgetItem(QObject* parent)
- : QObject(parent)
- {
- static QColor colors[12] = { QColor(229, 77, 66), QColor(243, 123, 29), QColor(251, 189, 8),
- QColor(141, 198, 63), QColor(57, 181, 74), QColor(28, 187, 180), QColor(0, 129, 255),
- QColor(103, 57, 182), QColor(156, 38, 176), QColor(224, 57, 151), QColor(165, 103, 63), QColor(135, 153, 163) };
- int i = qrand() % 12;
- m_color = colors[i];
- i = qrand() % 12;
- m_childColor = colors[i];
- m_parentItem = nullptr;
- }
- int KnowledgeGraphWidgetItem::id() const
- {
- return m_id;
- }
- void KnowledgeGraphWidgetItem::setId(int id)
- {
- m_id = id;
- }
- QString KnowledgeGraphWidgetItem::name() const
- {
- return m_name;
- }
- void KnowledgeGraphWidgetItem::setName(const QString& name)
- {
- m_name = name;
- }
- QString KnowledgeGraphWidgetItem::value() const
- {
- return m_value;
- }
- void KnowledgeGraphWidgetItem::setValue(const QString& value)
- {
- m_value = value;
- }
- KnowledgeGraphWidgetItem* KnowledgeGraphWidgetItem::parentItem() const
- {
- return m_parentItem;
- }
- void KnowledgeGraphWidgetItem::setParentItem(KnowledgeGraphWidgetItem* parentItem)
- {
- m_parentItem = parentItem;
- }
- int KnowledgeGraphWidgetItem::childsNum() const
- {
- return m_childsNum;
- }
- void KnowledgeGraphWidgetItem::setChildsNum(int childsNum)
- {
- m_childsNum = childsNum;
- }
- QColor KnowledgeGraphWidgetItem::color() const
- {
- return m_color;
- }
- void KnowledgeGraphWidgetItem::setColor(const QColor& color)
- {
- m_color = color;
- }
- QColor KnowledgeGraphWidgetItem::childColor() const
- {
- return m_childColor;
- }
- void KnowledgeGraphWidgetItem::setChildColor(const QColor& childColor)
- {
- m_childColor = childColor;
- }
- int KnowledgeGraphWidgetItem::index() const
- {
- return m_index;
- }
- void KnowledgeGraphWidgetItem::setIndex(int index)
- {
- m_index = index;
- }
- int KnowledgeGraphWidgetItem::startAngle() const
- {
- return m_startAngle;
- }
- void KnowledgeGraphWidgetItem::setStartAngle(int startAngle)
- {
- m_startAngle = startAngle;
- }
- bool KnowledgeGraphWidgetItem::hasCheck() const
- {
- return m_hasCheck;
- }
- void KnowledgeGraphWidgetItem::setHasCheck(bool hasCheck)
- {
- m_hasCheck = hasCheck;
- }
|