mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-05 17:55:25 +08:00
update
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
#include "FluRectangle.h"
|
||||
#include <QPainterPath>
|
||||
|
||||
FluRectangle::FluRectangle(QQuickItem* parent) : QQuickPaintedItem(parent){
|
||||
color(QColor(255,255,255,255));
|
||||
radius({0,0,0,0});
|
||||
connect(this,&FluRectangle::colorChanged,this,[=]{update();});
|
||||
connect(this,&FluRectangle::radiusChanged,this,[=]{update();});
|
||||
FluRectangle::FluRectangle(QQuickItem *parent) : QQuickPaintedItem(parent) {
|
||||
color(QColor(255, 255, 255, 255));
|
||||
radius({0, 0, 0, 0});
|
||||
connect(this, &FluRectangle::colorChanged, this, [=] { update(); });
|
||||
connect(this, &FluRectangle::radiusChanged, this, [=] { update(); });
|
||||
}
|
||||
|
||||
void FluRectangle::paint(QPainter* painter){
|
||||
void FluRectangle::paint(QPainter *painter) {
|
||||
painter->save();
|
||||
painter->setRenderHint(QPainter::Antialiasing);
|
||||
QPainterPath path;
|
||||
@ -22,6 +22,6 @@ void FluRectangle::paint(QPainter* painter){
|
||||
path.arcTo(QRectF(QPointF(rect.bottomLeft() - QPointF(0, _radius[3] * 2)), QSize(_radius[3] * 2, _radius[3] * 2)), 180, 90);
|
||||
path.lineTo(rect.bottomRight() - QPointF(_radius[2], 0));
|
||||
path.arcTo(QRectF(QPointF(rect.bottomRight() - QPointF(_radius[2] * 2, _radius[2] * 2)), QSize(_radius[2] * 2, _radius[2] * 2)), 270, 90);
|
||||
painter->fillPath(path,_color);
|
||||
painter->fillPath(path, _color);
|
||||
painter->restore();
|
||||
}
|
||||
|
Reference in New Issue
Block a user