14 int main(
int argc,
char** argv)
16 QApplication app(argc, argv);
17 QGraphicsScene scene(QRectF(0, 0, 400, 400));
18 QGraphicsView view(&scene);
20 QPushButton cmd(
"Quit");
21 QGraphicsProxyWidget* pproxyWidget = scene.addWidget(&cmd);
22 QTransform transform = pproxyWidget->transform();
24 transform.translate(100, 350);
25 transform.rotate(-45, Qt::YAxis);
26 transform.scale(8, 2);
27 pproxyWidget->setTransform(transform);
28 QObject::connect(&cmd, SIGNAL(clicked()), &app, SLOT(quit()));
31 dia.setNotchesVisible(
true);
32 pproxyWidget = scene.addWidget(&dia);
33 transform = pproxyWidget->transform();
35 transform.scale(4, 2);
36 transform.rotate(-45, Qt::YAxis);
37 pproxyWidget->setTransform(transform);
40 prb.setFixedSize(500, 40);
41 pproxyWidget = scene.addWidget(&prb);
42 transform = pproxyWidget->transform();
44 transform.translate(20, 200);
45 transform.scale(2, 2);
46 transform.rotate(80, Qt::YAxis);
47 transform.rotate(30, Qt::XAxis);
48 pproxyWidget->setTransform(transform);
50 QObject::connect(&dia, SIGNAL(valueChanged(
int)),
51 &prb, SLOT(setValue(
int))
55 view.resize(500, 500);
58 app.setStyle(
"Windows");
int main(int argc, char **argv)