17 lines
556 B
C++
17 lines
556 B
C++
#include "Base_Info.h"
|
|
|
|
#include "YSGraphic_Core/GenerateMockData.h"
|
|
#include "YSGraphic_Core/GlobalTypes.h"
|
|
|
|
namespace Psc {
|
|
Base_Info::Base_Info(int len, QString content) : len(len), content(std::move(content)) {
|
|
YSG::Range r{155, 255};
|
|
QColor random_color(YSG::getData(r), YSG::getData(r), YSG::getData(r));
|
|
background_color = random_color;
|
|
}
|
|
void Base_Info::paint(QPainter* painter, QRect rect) {
|
|
painter->fillRect(rect, background_color);
|
|
painter->drawText(rect, Qt::AlignCenter, content);
|
|
}
|
|
}
|