Loading...
Searching...
No Matches
QGraphicsPixmapToggle.hpp
1#pragma once
2#include <score/graphics/widgets/Constants.hpp>
3#include <score/widgets/Pixmap.hpp>
4
5#include <QGraphicsItem>
6#include <QGraphicsPixmapItem>
7#include <QObject>
8
9#include <score_lib_base_export.h>
10
11#include <verdigris>
12
13namespace score
14{
15class SCORE_LIB_BASE_EXPORT QGraphicsPixmapToggle final
16 : public QObject
17 , public QGraphicsPixmapItem
18{
19 W_OBJECT(QGraphicsPixmapToggle)
20 SCORE_GRAPHICS_ITEM_TYPE(150)
21
22 const QPixmap m_pressed, m_released;
23 bool m_toggled{};
24
25public:
26 QGraphicsPixmapToggle(QPixmap pressed, QPixmap released, QGraphicsItem* parent);
27
28 void toggle();
29 void setState(bool toggled);
30
31public:
32 void toggled(bool arg_1) E_SIGNAL(SCORE_LIB_BASE_EXPORT, toggled, arg_1)
33
34protected:
35 void mousePressEvent(QGraphicsSceneMouseEvent* event) override;
36 void mouseMoveEvent(QGraphicsSceneMouseEvent* event) override;
37 void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) override;
38};
39}
Definition QGraphicsPixmapToggle.hpp:18
Base toolkit upon which the software is built.
Definition Application.cpp:90