-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraphwidget.h
73 lines (60 loc) · 1.55 KB
/
graphwidget.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef GRAPHWIDGET_H
#define GRAPHWIDGET_H
#include "node.h"
#include "edge.h"
using namespace std;
#include<QGraphicsView>
#include<stdio.h>
#include<QPair>
#include<QMap>
#include<QPushButton>
#include<QTimer>
#include <QTextEdit>
#include <QTime>
#include<QLabel>
#include <QLineEdit>
#include <QCoreApplication>
#include <QEventLoop>
class node;
typedef QMap<node*, QPair<float,node*> > mypairtype;
typedef QList<QPair<node*,node*> > mylisttype;
class graphwidget: public QGraphicsView
{
Q_OBJECT
public:
graphwidget(QWidget *parent = 0 );
graphwidget(QWidget *parent,int a);
QGraphicsScene *scene= new QGraphicsScene(this);
mypairtype::iterator miner(mypairtype &mymap);
QTimer *timer = new QTimer(this);
void Delay(int millisecondsToWait);
node* getsource();
node* getdestination();
node *src= NULL;
node *dst= NULL;
bool contient(node *nd,mypairtype &mymap);
QGraphicsPixmapItem *poubelle = scene->addPixmap( QPixmap( "C:/Users/Hagui/Desktop/poubelle (1).jpg" ) );
//int rang();
protected:
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void timerEvent(QTimerEvent *event);
public slots:
void ParcoursProfondeur();
void ParcoursLargeur();
void connexe();
void Dijkstra();
void about();
void create();
void help();
void rang();
void reset();
private:
node *centerNode;
QList<node*> node_list;
QLineEdit*connexe_verify;
int timerId;
mypairtype mymap;
mylisttype pcc;
};
#endif // TESTGRAPHWIDGET_H