Hello all,
I can guess that the following warning it's not very important but how can I avoid it?
I derive a class from some base class. The compiler tells me that the copy constructor could not be generated for the base class. I get a similar second warning about the assignment operator.
The concrete example:
{
Q_OBJECT
public:
SliderWidget
(Qt
::Orientation orientation
= Qt
::Horizontal,
QWidget * parent
= 0 ):QGroupBox(parent
){
// here I call new for some widgets and do the connect stuff
}
//there is no destructor defined
};
class SliderWidget :public QGroupBox
{
Q_OBJECT
public:
SliderWidget(Qt::Orientation orientation = Qt::Horizontal, QWidget * parent = 0 ):QGroupBox(parent)
{
// here I call new for some widgets and do the connect stuff
}
//there is no destructor defined
};
To copy to clipboard, switch view to plain text mode
What would a copy constructor look like? Do I call new set all the member variables in the new instance and pass it back as the copy?
An assignement operator? Do I have to so the same as in the copy constructor?
thanks
K
Bookmarks