第一次提交
This commit is contained in:
39
MyButton.h
Normal file
39
MyButton.h
Normal 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
|
Reference in New Issue
Block a user