diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2008-06-23 13:16:36 +0200 |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2008-06-23 13:16:36 +0200 |
commit | bf6b869c9f0fc2d4e1279234eb5be248d9c9d129 (patch) | |
tree | 8bcb3b4192313cb52553e20a12c1391f23512edd /main.cpp | |
parent | 4ee8805b00b0b8f630563d995883c8f04280c841 (diff) |
Rename: GraphicsScene -> OpenGLScene
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -1,17 +1,30 @@ -#include "graphicsscene.h" +#include "openglscene.h" #include <QtOpenGL> +class GraphicsView : public QGraphicsView +{ +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); - QGraphicsView view(new GraphicsScene); + GraphicsView view; view.setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers))); view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); view.setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); view.setViewportUpdateMode(QGraphicsView::FullViewportUpdate); + view.setScene(new OpenGLScene); view.show(); + view.resize(1024, 768); + return app.exec(); } |