提交测试,基本完成
This commit is contained in:
@ -1,8 +1,9 @@
|
||||
//
|
||||
// Created by HW on 2023/07/26.
|
||||
//
|
||||
#define TEXT_SIZE 7
|
||||
#include "MyButton.h"
|
||||
#include "config.h"
|
||||
|
||||
MyButton::MyButton(ButtonStruct &buttonStruct,int width,int height,QList<MyButton *> *buttons,QWidget *parent) : QPushButton(parent) {
|
||||
this->buttons=buttons;
|
||||
this->width2=width;
|
||||
@ -30,7 +31,11 @@ MyButton::~MyButton() {
|
||||
|
||||
void MyButton::paintEvent(QPaintEvent *e) {
|
||||
QPushButton::paintEvent(e);
|
||||
QPainter painter(this);
|
||||
QRectF rect(0, 0, this->width(), this->height());
|
||||
QColor qColor;
|
||||
qColor.setNamedColor(background_color);
|
||||
QPainter painter(this);
|
||||
painter.fillRect(rect, qColor);
|
||||
painter.setRenderHint(QPainter::Antialiasing);
|
||||
int logo_width=width()/3;
|
||||
int logo_x=width()/3;
|
||||
|
Reference in New Issue
Block a user