2

I´m getting the following error on this piece of code.

QScopedPointer<NoteEvent> onEvent(new NoteEvent(date, chan, pitch, vel, true));
QScopedPointer<NoteEvent> offEvent(new NoteEvent(date + dur, chan, pitch, vel, false));
Score::noteStream->addNoteEvent(onEvent);
Score::noteStream->addNoteEvent(offEvent);


void NoteStream::addNoteEvent(QScopedPointer<NoteEvent> noteEvent)
{
    noteEvents->push_back(noteEvent);
}

Error: C2248: "QScopedPointer": No access to private member declared in QScopedPointer

Reading through other posts was not helpful.

demonplus
  • 5,613
  • 12
  • 49
  • 68
user2052244
  • 308
  • 3
  • 14

1 Answers1

4

QScopedPointer doesn't have a public copy constructor. It cannot be passed around by value, nor stored in containers that require its elements to be copyable (which noteEvents might be, depending on how it's declared).

Igor Tandetnik
  • 50,461
  • 4
  • 56
  • 85