添加了首页的雏形,和一个关于如何添加页面的文档

This commit is contained in:
RigoLigoRLC
2022-02-06 20:16:04 +08:00
parent 7756bda006
commit 58a0336a23
10 changed files with 443 additions and 2 deletions

35
gui/spknotifydot.cpp Normal file
View File

@@ -0,0 +1,35 @@
#include <QPaintEvent>
#include <QPainter>
#include <QBrush>
#include "spknotifydot.h"
#include "spkstore.h"
/*
* The font size and the actual geometry of this widget is hard coded
* If you want to use this widget code please consider improving it
*/
SpkNotifyDot::SpkNotifyDot(QWidget *parent) :
QLabel(parent)
{
}
void SpkNotifyDot::paintEvent(QPaintEvent *e)
{
QPainter p(this);
int h = height();
p.setRenderHint(QPainter::Antialiasing);
p.setBrush(QBrush(QColor(255, 70, 50)));
p.setPen(Qt::transparent);
p.drawEllipse(0, 0, h, h);
p.setBrush(QBrush(QColor(Qt::white)));
p.setPen(Qt::white);
p.setFont(QFont("sansserif", 10, 1000));
p.drawText(QRect(0, 0, h, h), Qt::AlignHCenter | Qt::AlignVCenter, text());
p.end();
}