#ifndef FAVBUTTON_H #define FAVBUTTON_H #include #include class FavButtonStyle : public QProxyStyle { public: FavButtonStyle(); ~FavButtonStyle() override = default; // QStyle interface public: void drawItemText(QPainter *painter, const QRect &rect, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole) const override; private: Q_DISABLE_COPY(FavButtonStyle) }; class FavButton : public QToolButton { Q_OBJECT public: explicit FavButton(QWidget *parent = nullptr); signals: void itemDropped(); // QWidget interface protected: void dragEnterEvent(QDragEnterEvent *event) override; void dropEvent(QDropEvent *event) override; private: FavButtonStyle m_style; }; #endif // FAVBUTTON_H