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:
#ifndef SIGNALWIDGET
#define SIGNALWIDGET
#include <QtGui>
#include <QWidget>
class SignalWidget
: public QWidget {
Q_OBJECT
public:
};
#endif
#ifndef SIGNALWIDGET
#define SIGNALWIDGET
#include <QtGui>
#include <QWidget>
class SignalWidget : public QWidget
{
Q_OBJECT
public:
SignalWidget(QWidget *parent = 0);
};
#endif
To copy to clipboard, switch view to plain text mode
and
#include "signalwidget.h"
SignalWidget
::SignalWidget(QWidget *parent
){
}
#include "signalwidget.h"
SignalWidget::SignalWidget(QWidget *parent)
: QWidget(parent)
{
}
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!
Bookmarks