我有一个我认为是指向指针的指针,并希望获得指针的对象,指针也指向。或获取指针指向的指针,该指针是对象指针。
QGraphicsScene * scene = new QGraphicsScene();
ui->GraphicsView->setScene(scene);
loc.setPointer(&scene);
位置类,对象位置。
setPointer(QGraphicsScene* x) {
scene = x;
}
它说 QGraphicsScene** 无法转换为 QGraphicsScene*。所以我假设 ** 表示指向指针的指针。
最佳答案
试试这个:
QGraphicsScene * scene = new QGraphicsScene();
ui->GraphicsView->setScene(scene);
loc.setPointer(scene);
&scene 是指向场景指针的指针
关于C++/Qt获取指向指针的指针的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23481273/