At least this works for me:
#include <QtGui>
int main(int argc, char *argv[])
{
view.setScene(&scene);
Q_UNUSED(label);
view.show();
return a.exec();
}
#include <QtGui>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QGraphicsScene scene;
QGraphicsItem* item = scene.addRect(QRectF(0,0,25,25));
item->setFlag(QGraphicsItem::ItemIsMovable);
QGraphicsView view;
view.setScene(&scene);
QLabel* label = new QLabel("Test", &view);
Q_UNUSED(label);
view.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks