You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#ifndef FAVBUTTON_H
|
|
|
|
#define FAVBUTTON_H
|
|
|
|
|
|
|
|
#include <QToolButton>
|
|
|
|
#include <QProxyStyle>
|
|
|
|
|
|
|
|
class FavButtonStyle : public QProxyStyle
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FavButtonStyle();
|
|
|
|
virtual ~FavButtonStyle();
|
|
|
|
|
|
|
|
// QStyle interface
|
|
|
|
public:
|
|
|
|
void drawItemText(QPainter *painter, const QRect &rect, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY(FavButtonStyle)
|
|
|
|
};
|
|
|
|
|
|
|
|
class FavButton : public QToolButton
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
FavButton(QWidget *parent = 0);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void itemDropped();
|
|
|
|
|
|
|
|
// QWidget interface
|
|
|
|
protected:
|
|
|
|
virtual void dragEnterEvent(QDragEnterEvent *event) override;
|
|
|
|
virtual void dropEvent(QDropEvent *event) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
FavButtonStyle m_style;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FAVBUTTON_H
|