diff options
Diffstat (limited to 'old/tests/qtuitest/testapps/graphicsViewTest/mainwindow.cpp')
-rw-r--r-- | old/tests/qtuitest/testapps/graphicsViewTest/mainwindow.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/old/tests/qtuitest/testapps/graphicsViewTest/mainwindow.cpp b/old/tests/qtuitest/testapps/graphicsViewTest/mainwindow.cpp new file mode 100644 index 0000000..45e3c88 --- /dev/null +++ b/old/tests/qtuitest/testapps/graphicsViewTest/mainwindow.cpp @@ -0,0 +1,35 @@ +#include <QtGui> + + +#include "mainwindow.h" + +MainWindow::MainWindow() +{ + const QString pixmapString = "qtlogo4.png"; + item = new QGraphicsPixmapItem(pixmapString); + + textItem = new QGraphicsTextItem("here is some text"); + textItem->setTextInteractionFlags(Qt::TextEditable); + QGraphicsTextItem *textItem2 = new QGraphicsTextItem("and here is some more"); + textItem2->setTextInteractionFlags(Qt::TextEditable); + textItem2->setPos(20, 30); + scene = new QGraphicsScene(); +// scene->addItem(item); + scene->addItem(textItem); + scene->addItem(textItem2); + scene->setBackgroundBrush(Qt::lightGray); + + view = new QGraphicsView(scene); + view->rotate(-30); + QHBoxLayout *layout = new QHBoxLayout; + layout->addWidget(view); + QLabel *label = new QLabel("hello world"); + layout->addWidget(label); + QWidget *widget = new QWidget; + widget->setLayout(layout); + + setCentralWidget(widget); + setWindowTitle(tr("Diagramscene")); + + +} |