-
Notifications
You must be signed in to change notification settings - Fork 1
/
myscene.h
49 lines (39 loc) · 1.06 KB
/
myscene.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef MYSCENE_H
#define MYSCENE_H
#include <QtGui>
#include <QtWidgets>
#include <QDebug>
#include "component.h"
#include "resistor.h"
#include "capacitor.h"
#include "ground.h"
#include "mainwindow.h"
class MyScene : public QGraphicsScene
{
Q_OBJECT
public:
MyScene(QObject *parent = 0);
void setMode(int mode);
void setDrawingItem(QString itemtype);
public slots:
void exportScene();
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent);
void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent);
private:
// a "temporary" line to connect the startComponent with the curent mouse position while drawing a wire
QGraphicsLineItem *line;
int mode;
QString itemtype;
int numComponents;
Component *startComponent;
QPointF startPoint;
// all components within the current schematic
QList<Component*> components;
// all wires...
QList<Wire*> wires;
void NameWire(Component*, int);
int netNum;
};
#endif // MYSCENE_H