mirror of
https://github.com/edisionnano/QDiskInfo.git
synced 2026-03-08 04:19:59 +03:00
30 lines
671 B
C++
30 lines
671 B
C++
#ifndef CUSTOMBUTTON_H
|
|
#define CUSTOMBUTTON_H
|
|
|
|
#include <QPushButton>
|
|
#include <QPainter>
|
|
|
|
class CustomButton : public QPushButton {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
CustomButton(const QString &text1, const QString &text2, const QString &text3, const QColor &lineColor, QWidget *parent = nullptr);
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent *event) override;
|
|
void resizeEvent(QResizeEvent *event) override;
|
|
void setText1(const QString &newText1);
|
|
void setText2(const QString &newText2);
|
|
void setText3(const QString &newText3);
|
|
void adjustWidthToFitText();
|
|
|
|
|
|
private:
|
|
QString text1;
|
|
QString text2;
|
|
QString text3;
|
|
QColor lineColor;
|
|
};
|
|
|
|
#endif
|