繁体   English   中英

C ++ / Qt获取指针的指针值

[英]C++/Qt getting the value of pointer to a pointer

我有我认为是一个指针的指针,并希望获得指针对象,指针也指向。 或者获取指针指向的指针,该指针是一个对象指针。

QGraphicsScene * scene = new QGraphicsScene();
ui->GraphicsView->setScene(scene);
loc.setPointer(&scene);

位置类,对象loc。

setPointer(QGraphicsScene* x) {
    scene = x;
}

它说QGraphicsScene **无法转换为QGraphicsScene *。 所以我假设**表示指向指针的指针。

尝试这个:

QGraphicsScene * scene = new QGraphicsScene();
ui->GraphicsView->setScene(scene);
loc.setPointer(scene);

&scene是指向场景指针的指针

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM