graphpoint.cpp 758 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #include "graphpoint.h"
  2. GraphPoint::GraphPoint(const GitOid &commitOid, QObject* parent) : QObject(parent)
  3. ,m_commitOid(commitOid)
  4. ,m_x(0)
  5. ,m_y(0)
  6. {
  7. }
  8. GraphPoint::GraphPoint(const GitOid &commitOid, int x, int y, const QString &color, QObject *parent) : QObject(parent)
  9. ,m_commitOid(commitOid)
  10. ,m_x(x)
  11. ,m_y(y)
  12. ,m_color(color)
  13. {
  14. }
  15. GraphPoint::~GraphPoint()
  16. {
  17. }
  18. void GraphPoint::setX(int x)
  19. {
  20. if (m_x == x) {
  21. return;
  22. }
  23. m_x = x;
  24. emit xChanged(x);
  25. }
  26. void GraphPoint::setY(int y)
  27. {
  28. if (m_y == y) {
  29. return;
  30. }
  31. m_y = y;
  32. emit yChanged(y);
  33. }
  34. void GraphPoint::setColor(const QString& color)
  35. {
  36. if (m_color == color) {
  37. return;
  38. }
  39. m_color = color;
  40. emit colorChanged(color);
  41. }