Cant use QWidget::setParent().
Hi.
I have a new class called Piece, tried to inherit QLabel or QPushButton, everything is good, but once I try to set a parent (QWidget *container) its says
error: "void QWidget::setParent(QWidget*)' is inaccessible
void setParent(QWidget *parent);
^."
After see that QLabel wasn't working, tried with QPushButton and happened the same thing.
My Example Class:
Code:
#ifndef PIECE_H
#define PIECE_H
#include <QPushButton>
#include <QMouseEvent>
Q_OBJECT
public:
Piece();
};
#endif // PIECE_H
Re: Cant use QWidget::setParent().
Your code uses private inheritance, all the methods of the base class are then private.
You want public inheritance
Cheers,
_
Re: Cant use QWidget::setParent().