首次提交
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user