// // Created by HW on 2023/07/26. // #ifndef OFFICEASSISTANT_MYBUTTON_H #define OFFICEASSISTANT_MYBUTTON_H #include #include #include #include #include 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