Hello,

it should be really easy but something just doesn't work and i can't find the problem.

I try to create my own Widget by subclassing QWidget.

For testing i have now removed every code so that the new Widget looks like this:

Qt Code:
  1. #ifndef SIGNALWIDGET
  2. #define SIGNALWIDGET
  3.  
  4. #include <QtGui>
  5. #include <QWidget>
  6.  
  7. class SignalWidget : public QWidget
  8. {
  9. Q_OBJECT
  10.  
  11. public:
  12. SignalWidget(QWidget *parent = 0);
  13. };
  14.  
  15. #endif
To copy to clipboard, switch view to plain text mode 

and

Qt Code:
  1. #include "signalwidget.h"
  2.  
  3.  
  4. SignalWidget::SignalWidget(QWidget *parent)
  5. : QWidget(parent)
  6. {
  7. }
To copy to clipboard, switch view to plain text mode 

i would say that there is nothing which could be wrong.

If i now try to create a instance of this widget in my main application with " SignalWidget sw = new SignalWidget();" i get this error message:

/usr/include/qt4/QtGui/qwidget.h: In copy constructor ‘SignalWidget::SignalWidget(const SignalWidget&)’:
/usr/include/qt4/QtGui/qwidget.h:746: error: ‘QWidget::QWidget(const QWidget&)’ is private
src/signalwidget.h:8: error: within this context
src/robotcontrol.cpp: In constructor ‘RobotControl::RobotControl(QWidget*)â€℠¢:
src/robotcontrol.cpp:14: note: synthesized method ‘SignalWidget::SignalWidget(const SignalWidget&)’ first required here
src/robotcontrol.cpp:14: error: initializing temporary from result of ‘SignalWidget::SignalWidget(QWidget*)â€℠¢
make: *** [robotcontrol.o] Error 1
Does someone has an idea what's wrong?

Thanks!