1 /* stock_icon_tool_button.h
2  *
3  * Wireshark - Network traffic analyzer
4  * By Gerald Combs <gerald@wireshark.org>
5  * Copyright 1998 Gerald Combs
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  */
9 
10 #ifndef STOCKICONTOOLBUTTON_H
11 #define STOCKICONTOOLBUTTON_H
12 
13 #include <QToolButton>
14 
15 class StockIconToolButton : public QToolButton
16 {
17 public:
18     explicit StockIconToolButton(QWidget * parent = 0, QString stock_icon_name = QString());
19 
20     void setIconMode(QIcon::Mode mode = QIcon::Normal);
21     void setStockIcon(QString icon_name = QString());
22 
23 protected:
24     virtual bool event(QEvent *event);
25 
26 private:
27     QIcon base_icon_;
28     QString icon_name_;
29     int leave_timer_;
30     static const int leave_interval_ = 500; // ms
31 };
32 
33 #endif // STOCKICONTOOLBUTTON_H
34