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
| #include "maf.h"
MaF::MaF()
{
QMdiArea *zoneCentrale2 = new QMdiArea;
QMdiSubWindow *zoneTexte1 = new QMdiSubWindow;
QMdiSubWindow *sousFenetre1 = zoneCentrale2->addSubWindow(zoneTexte1);
setCentralWidget(zoneCentrale2);
QGraphicsScene scene;
QPixmap monPixmap("ouvrir.png");
scene.addPixmap(monPixmap);
QRect rectangle(-8, -4, 100, 100);
QPen pen(Qt::blue, 1, Qt::SolidLine);
scene.addRect(rectangle, pen);
scene.setBackgroundBrush(Qt::white);
QGraphicsView *vue = new QGraphicsView(&scene, sousFenetre1);
vue->setFixedSize(250, 250);
vue->move(100,100);
vue->show();
} |