Hello,

This incomplete func compiles and works. But item->pos().x(); always returns 0 to the variable xxx when run in the debugger (Win 7, mingw release w/ sdk). Note that the following data variables are filled properly from the items so we know that the rest of the mechanism is working. Could this actually be a bug in QT 4.7 or have I misunderstood the value function? I'm stumped on this one. Thanks.


Qt Code:
  1. QList<QGraphicsItem*> Note::getNotesInMeasure()
  2. {
  3. extern QGraphicsScene* scene;
  4. QList<QGraphicsItem*>iList;
  5.  
  6. iList = scene->selectedItems();
  7.  
  8. if (!( iList.isEmpty() || iList.size() == 0 )){
  9. int sz = iList.size();
  10. int i;
  11. for (i=0; i<sz; i++){
  12. item = iList.value(i);
  13. int xxx = item->pos().x();
  14. QString n = item->data(2).toString();
  15. QString h = item->data(0).toString();
  16. if ( n == "Note" ) { msg(h); }
  17. }
  18.  
  19. }
  20. return iList;
  21. }
To copy to clipboard, switch view to plain text mode