I have same problem. How can I rotate a widget which on another widget? This is my code:
..
item->rotate(45);
scene->addItem(item);
ui->graphicsView->setScene(scene);
..
QGraphicsScene *scene = new QGraphicsScene(ui->gemiSekme);
QGraphicsItem *item = new QGraphicsItem(ui->label_2);
item->rotate(45);
scene->addItem(item);
ui->graphicsView->setScene(scene);
To copy to clipboard, switch view to plain text mode
I get this error:
error: cannot allocate an object of abstract type 'QGraphicsItem'
error: cannot allocate an object of abstract type 'QGraphicsItem'
To copy to clipboard, switch view to plain text mode
Also I tried this code, does not run.
..
QGraphicsProxyWidget *proxy = scene.addWidget(ui->label_2);
proxy->rotate(20);
ui->graphicsView->setScene( &scene);
ui->graphicsView->show();
..
QGraphicsScene scene;
QGraphicsProxyWidget *proxy = scene.addWidget(ui->label_2);
proxy->rotate(20);
ui->graphicsView->setScene( &scene);
ui->graphicsView->show();
To copy to clipboard, switch view to plain text mode
Thanks for your time.
Bookmarks