Changeset View
Changeset View
Standalone View
Standalone View
kgamepopupitem.cpp
Show All 38 Lines | |||||
39 | { | 39 | { | ||
40 | Q_OBJECT | 40 | Q_OBJECT | ||
41 | 41 | | |||
42 | public: | 42 | public: | ||
43 | TextItemWithOpacity( QGraphicsItem* parent = nullptr ) | 43 | TextItemWithOpacity( QGraphicsItem* parent = nullptr ) | ||
44 | :QGraphicsTextItem(parent), m_opacity(1.0) {} | 44 | :QGraphicsTextItem(parent), m_opacity(1.0) {} | ||
45 | void setOpacity(qreal opa) { m_opacity = opa; } | 45 | void setOpacity(qreal opa) { m_opacity = opa; } | ||
46 | void setTextColor(const KStatefulBrush &brush) { m_brush = brush; } | 46 | void setTextColor(const KStatefulBrush &brush) { m_brush = brush; } | ||
47 | void paint( QPainter* p, const QStyleOptionGraphicsItem *option, QWidget* widget ) Q_DECL_OVERRIDE; | 47 | void paint( QPainter* p, const QStyleOptionGraphicsItem *option, QWidget* widget ) override; | ||
48 | 48 | | |||
49 | Q_SIGNALS: | 49 | Q_SIGNALS: | ||
50 | void mouseClicked(); | 50 | void mouseClicked(); | ||
51 | 51 | | |||
52 | private: | 52 | private: | ||
53 | void mouseReleaseEvent(QGraphicsSceneMouseEvent*) Q_DECL_OVERRIDE; | 53 | void mouseReleaseEvent(QGraphicsSceneMouseEvent*) override; | ||
54 | 54 | | |||
55 | private: | 55 | private: | ||
56 | qreal m_opacity; | 56 | qreal m_opacity; | ||
57 | KStatefulBrush m_brush; | 57 | KStatefulBrush m_brush; | ||
58 | }; | 58 | }; | ||
59 | 59 | | |||
60 | void TextItemWithOpacity::paint( QPainter* p, const QStyleOptionGraphicsItem *option, QWidget* widget ) | 60 | void TextItemWithOpacity::paint( QPainter* p, const QStyleOptionGraphicsItem *option, QWidget* widget ) | ||
61 | { | 61 | { | ||
▲ Show 20 Lines • Show All 477 Lines • Show Last 20 Lines |