我实现了一个自定义Callout类,如本例中的Callout Example
QPolarChart *chart = new QPolarChart();
Callout *callout = new Callout(chart);如果我只能访问图表(callout超出范围),我如何重新获得callout的访问权限。我想过要用
QObjectList children = chart->children();但是callout不在这里。如何再次访问callout?
发布于 2018-07-19 19:22:00
您必须使用childItems(),这将返回QGraphicsItem的子对象。
for(QGraphicsItem *childItem: chart->childItems()){
if(Callout *c = dynamic_cast<Callout *>(childItem)){
//use c
}
}https://stackoverflow.com/questions/51420994
复制相似问题