void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
MyObj* obj = new MyObj();obj->setPos(300,300);scene->addItem(obj);
void TableSubStrate::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/){ qDebug("--- %f %f",pos().x(),pos().y()); QPointF _pt = mapFromScene(pos()); qDebug("#--- %f %f",_pt.x(),_pt.y());}--- 370.000000 110.000000#--- 0.000000 0.000000--- 47.000000 320.000000#--- 0.000000 0.000000--- 105.000000 178.000000#--- 0.000000 0.000000--- 224.000000 119.000000#--- 0.000000 0.000000
void ChipsImage::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*option*/, QWidget * /*widget*/){ QPointF _pt = pos(); _pt.setX(_pt.x() / 2); _pt.setY(_pt.y() / 2);}
C++ (Qt)item.mapFromScene(item.pos())