How about
#include <QtGui>
int main( int argc, char **argv )
{
QPixmap pixmap
(":/trolltech/styles/commonstyle/images/standardbutton-help-32.png");
for (int i=0;i<50;i++){
item->moveBy(qrand()%200-100, qrand()%200-100);
item->rotate(qrand()%360);
}
view.
setRenderHints( QPainter::SmoothPixmapTransform );
view.show();
return app.exec();
}
#include <QtGui>
int main( int argc, char **argv )
{
QApplication app(argc, argv);
QGraphicsScene scene;
QGraphicsView view(&scene);
QPixmap pixmap(":/trolltech/styles/commonstyle/images/standardbutton-help-32.png");
for (int i=0;i<50;i++){
QGraphicsPixmapItem* item = scene.addPixmap(pixmap);
item->moveBy(qrand()%200-100, qrand()%200-100);
item->rotate(qrand()%360);
item->setFlag(QGraphicsItem::ItemIsMovable);
}
view.setRenderHints( QPainter::SmoothPixmapTransform );
view.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
or if you're going for brevity
#include <QtGui>
int main( int argc, char **argv )
{
view.
scene()->addPixmap
(QPixmap(":/trolltech/styles/commonstyle/images/standardbutton-help-32.png"));
view.show();
return app.exec();
}
#include <QtGui>
int main( int argc, char **argv )
{
QApplication app(argc, argv);
QGraphicsView view(new QGraphicsScene );
view.scene()->addPixmap(QPixmap(":/trolltech/styles/commonstyle/images/standardbutton-help-32.png"));
view.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks