mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Better use of QObject inheritence
This commit is contained in:
@@ -23,15 +23,14 @@
|
|||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
|
|
||||||
DiagramEventInterface::DiagramEventInterface(Diagram *diagram) :
|
DiagramEventInterface::DiagramEventInterface(Diagram *diagram) :
|
||||||
m_diagram(diagram),
|
QObject{diagram},
|
||||||
m_running(false),
|
m_diagram{diagram}
|
||||||
m_abort(false)
|
|
||||||
{
|
{
|
||||||
m_diagram -> clearSelection();
|
m_diagram -> clearSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
DiagramEventInterface::~DiagramEventInterface()
|
DiagramEventInterface::~DiagramEventInterface()
|
||||||
{};
|
{}
|
||||||
|
|
||||||
void DiagramEventInterface::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
|
void DiagramEventInterface::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
|
||||||
Q_UNUSED (event);
|
Q_UNUSED (event);
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#define DIAGRAMEVENTINTERFACE_H
|
#define DIAGRAMEVENTINTERFACE_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QPointer>
|
||||||
|
|
||||||
class QGraphicsSceneMouseEvent;
|
class QGraphicsSceneMouseEvent;
|
||||||
class QGraphicsSceneWheelEvent;
|
class QGraphicsSceneWheelEvent;
|
||||||
@@ -63,9 +64,9 @@ class DiagramEventInterface : public QObject
|
|||||||
void finish(); //Emited when the interface finish is job.
|
void finish(); //Emited when the interface finish is job.
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Diagram *m_diagram;
|
QPointer<Diagram> m_diagram;
|
||||||
bool m_running;
|
bool m_running{false};
|
||||||
bool m_abort;
|
bool m_abort{false};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIAGRAMEVENTINTERFACE_H
|
#endif // DIAGRAMEVENTINTERFACE_H
|
||||||
|
|||||||
Reference in New Issue
Block a user