XX CMake Package
Loading...
Searching...
No Matches
XXManagedGraphicsView.h
Go to the documentation of this file.
1#ifndef XXManagedGraphicsViewH
2#define XXManagedGraphicsViewH
3
5#include <QGraphicsView>
6
7namespace XX
8{
9 namespace Managed
10 {
14
15 class XXWIDGETS_DECLSPEC GraphicsView : public QGraphicsView
16 {
17 Q_OBJECT
18
19 public:
20 GraphicsView(QWidget* parent);
21
22 public:
23 template <typename TargetClass>
24 void onClicked(TargetClass* instance, bool (TargetClass::*memberFunction)(const QPointF&, QGraphicsItem*));
25
27
28 private:
29 using ClickFunction = std::function<bool(const QPointF&, QGraphicsItem*)>;
30
31 private:
32 void mousePressEvent(QMouseEvent* event) override;
33
34 private:
35 ClickFunction mousePressFunction;
36 };
37 } // namespace Managed
38} // namespace XX
39
40#ifndef XXManagedGraphicsViewHPP
41#include "XXManagedGraphicsView.hpp"
42#endif // NOT XXManagedGraphicsViewHPP
43
44#endif // NOT XXManagedGraphicsViewH
#define XXWIDGETS_DECLSPEC
Definition XXWidgetsExportDef.h:11
GraphicsView(QWidget *parent)
void onClicked(TargetClass *instance, bool(TargetClass::*memberFunction)(const QPointF &, QGraphicsItem *))
Definition XXManagedGraphicsView.h:10
Definition XXPopulatedAbstract.h:11