I am trying to move with the mouse a push button on a QGraphicsView but is not working, some body can help me whit my issue?
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
MainWindow windows;
QGraphicsScene scene(&windows);
QGraphicsView view(&scene, &windows);
QGraphicsProxyWidget *proxy = scene.addWidget(new QPushButton("MOVE IT"));
proxy->setFlags(QGraphicsItem::ItemIsMovable |
QGraphicsItem::ItemIsSelectable |
QGraphicsItem::ItemSendsGeometryChanges |
QGraphicsItem::ItemSendsScenePositionChanges);
windows.setCentralWidget(&view);
windows.show();
return app.exec();
}
PD: Ignore my memory leaks here please.