第一次提交

This commit is contained in:
Mike Solar
2023-07-26 19:48:14 +08:00
commit 25daaecbc0
23 changed files with 447 additions and 0 deletions

39
MyButton.h Normal file
View File

@ -0,0 +1,39 @@
//
// Created by HW on 2023/07/26.
//
#ifndef OFFICEASSISTANT_MYBUTTON_H
#define OFFICEASSISTANT_MYBUTTON_H
#include <QPushButton>
#include <QPaintEvent>
#include <QtSvg/QtSvg>
#include <QtSvg/QSvgWidget>
#include <QtSvg/QSvgRenderer>
class MyButton: public QPushButton{
public:
MyButton(QString logo,QString text,int width,int height,QWidget *parent=nullptr);
~MyButton() override;
QString getText(){
return text;
}
QSize sizeHint() const override {
return QSize(width2/2,height2/2);
}
protected:
void paintEvent(QPaintEvent *e) override;
private:
QImage *logo;
QLabel *logo_label;
QLabel *text_label;
QVBoxLayout *layout;
QPixmap* logo_pixmap;
QString text;
int width2;
int height2;
};
#endif //OFFICEASSISTANT_MYBUTTON_H