Hello,

I derived my own class from QFrame and now I can't put it into a QList. It complains about the copy constructor of QFrame being private.

Qt Code:
  1. class KeyFrame : public QFrame
  2. {
  3. int id;
  4. public:
  5. KeyFrame(QWidget *widget);
  6. virtual ~KeyFrame();
  7. int getId();
  8. }
  9.  
  10.  
  11. main
  12. {
  13. KeyFrame kf(ui.someWidget);
  14.  
  15. QList<KeyFrame> frameBuffer;
  16. frameBuffer.append(kf); // BOOM
  17. }
To copy to clipboard, switch view to plain text mode 


linux-g++ -I. -I/usr/local/Trolltech/Qt-4.4.3/include/QtCore -I/usr/local/Trolltech/Qt-4.4.3/include/QtCore -I/usr/local/Trolltech/Qt-4.4.3/include/QtGui -I/usr/local/Trolltech/Qt-4.4.3/include/QtGui -I/usr/local/Trolltech/Qt-4.4.3/include/QtOpenGL -I/usr/local/Trolltech/Qt-4.4.3/include/QtOpenGL -I/usr/local/Trolltech/Qt-4.4.3/include -I/usr/X11R6/include -Idebug -I. -o debug/MotionEditor.o MotionEditor.cpp
/usr/local/Trolltech/Qt-4.4.3/include/QtGui/qframe.h: In copy constructor ‘KeyFrame::KeyFrame(const KeyFrame&)’:
KeyFrame.h:15: instantiated from ‘void QList<T>::append(const T&) [with T = KeyFrame]’
MotionEditor.cpp:31: instantiated from here
/usr/local/Trolltech/Qt-4.4.3/include/QtGui/qframe.h:136: error: ‘QFrame::QFrame(const QFrame&)’ is private
KeyFrame.h:15: error: within this context
What should I do now? I HAVE to subclass some Widget to override the paintEvent() method and I would really like to use the nice Qt Collections.

Thanks
Cruz