I want to move the QPushButton or kind of QWidget in QGraphicsView for example QListWidet, QTableWidget etc.
So, I used QGraphicsProxyWidget.
Then I clicked the widget and drag. But It is not moving.
How can i move QWidget?
This is my code.
ui->graphicsView->setGeometry(0,0,geometry().width(),geometry().height());
scene = new QGraphicsScene(0, 0, geometry().width(), geometry().height(), this);
ui->graphicsView->setScene(scene);
btn =new QPushButton(NULL);
QGraphicsProxyWidget *proxy = scene->addWidget(btn);
proxy->setFlags(QGraphicsItem::ItemIsMovable|QGraphicsItem::ItemIsSelectable);
scene->addItem(proxy);
Can you tell me What is wrong?
Thanks.