-
Notifications
You must be signed in to change notification settings - Fork 1
/
viewer.cc
44 lines (32 loc) · 842 Bytes
/
viewer.cc
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
#include "Scene.hh"
#include <QtGui>
#include <QGLWidget>
using namespace Qt;
//#warning "viewer.cc included"
class GraphicsView : public QGraphicsView
{
public:
GraphicsView()
{
setWindowTitle(tr("Cura Edit Interface"));
}
protected:
void resizeEvent(QResizeEvent *event) {
if (scene())
scene()->setSceneRect(QRect(QPoint(0, 0), event->size()));
QGraphicsView::resizeEvent(event);
}
};
int main(int argc, char **argv)
{
QApplication app(argc, argv);
GraphicsView view;
view.setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers)));
view.setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
Scene *scene = new Scene();
view.setScene(scene);
view.show();
std::cout << "main" << "\n";
view.resize(1024, 768);
return app.exec();
}