PaperGraphWidget.cpp
797 Bytes
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
#include "PaperGraphWidget.h"
#include "NodeItem.h"
#include "GraphicsView.h"
PaperGraphWidget::PaperGraphWidget(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
initscene();
View *view = new View("temp view");
view->view()->setScene(scene);
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(view);
setLayout(layout);
setWindowTitle(tr("dblp paper graph visualization"));
}
void PaperGraphWidget::print_graph(const Graph & graph)
{
//print graph
}
void PaperGraphWidget::initscene()
{
scene = new QGraphicsScene(this);
//int x = 0, y;
//for (int i=-11000; i<11000; i+=110) {
// ++x;
// y = 0;
// for (int j=-7000; j<7000; j+=70) {
// ++y;
// QGraphicsItem *item = new NodeItem(x, y);
// item->setPos(QPointF(i, j));
// scene->addItem(item);
// }
//}
}