I'm a bit confused, because I thought QSet could hold structs, but I keep getting an error "c:\QtSDK\Desktop\Qt\4.7.4\mingw\include\QtCore\qh ash.h:880: error: no matching function for call to 'qHash(const NoteStruct&)'"

Here's the struct:

Qt Code:
  1. struct NoteStruct
  2. {
  3. float startPosition;
  4. float width;
  5. QGraphicsItem *noteLane;
  6. int velocity;
  7. };
To copy to clipboard, switch view to plain text mode 

Here's the offending method:

Qt Code:
  1. void SequencerScene::copy()
  2. {
  3. currentlyCopiedNotes.clear();
  4.  
  5. foreach (QGraphicsItem *note, selectedItems())
  6. {
  7. NoteStruct newNote;
  8. newNote.startPosition = note->transform().dx();
  9. newNote.width = note->boundingRect().width();
  10. newNote.noteLane = note->parentItem();
  11. newNote.velocity = static_cast<Note*>(note)->getVelocity();
  12.  
  13. currentlyCopiedNotes.insert(newNote); // THIS IS THE OFFENDING CODE
  14. }
  15. }
To copy to clipboard, switch view to plain text mode 

And here's the declaration of currentlyCopiedNotes (in the header file):

Qt Code:
  1. private:
  2. QSet<NoteStruct> currentlyCopiedNotes;
To copy to clipboard, switch view to plain text mode 

The reason I'm trying to do this is that I am creating a way to copy notes (QGraphicsItems) in a QGraphicsScene, so that they can be pasted afterwards. The NoteStruct is a struct containing the attributes of the notes.

I'd appreciate some advice... thanks!