#ifndef MYSELECTIVEBUTTON_H #define MYSELECTIVEBUTTON_H #include #include #include #include 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