Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 7

Qt-interest Archive, July 2007
Question about QGraphicsItem's child rotation


Message 1 in thread

Hi

I have a question for QT experts... this is my situation:

A      is a QGraphicsItem
B,C,D  are  QGraphicsItems ITEMS placed inside of A (A is given as their
parent)

On A, I use this piece of code to know if user click on a sub-item of A:

---
mousePressEvent(QGraphicsSceneMouseEvent *event){

int ipos;
int itemindex=-1;

for (int i=0; i<3; i++){
    ipos = ITEMS[i]->mapFromParent(event->pos);
    if (ITEMS[i]->contains(ipos)){
       itemindex=i;
       break;
       }
    }

// itemindex contain the item number I have clicked on
}
---

this works well until A is rotated... then fails... 

What should I do to take care of A rotation ?

  thanks a lot

      Paolo


--
 [ signature omitted ]