You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
676 B

6 months ago
#ifndef MYSELECTIVEBUTTON_H
#define MYSELECTIVEBUTTON_H
#include <QToolButton>
#include <QLabel>
#include <QStringList>
#include <QEnterEvent>
class mySelectiveButton : public QToolButton
{
Q_OBJECT
public:
explicit mySelectiveButton(QWidget *parent = nullptr);
mySelectiveButton(int _itemID, QWidget *parent = nullptr);
~mySelectiveButton();
static QStringList itemDescriptions; // 项目描述的静态列表
void enterEvent(QEvent *event) override;
void leaveEvent(QEvent *event) override;
private:
QLabel* label = nullptr; // 用于显示信息的标签
int itemID; // 项目标识符
};
#endif // MYSELECTIVEBUTTON_H