vitaR
1st July 2014, 04:26
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:
#ifndef PIECE_H
#define PIECE_H
#include <QPushButton>
#include <QMouseEvent>
class Piece : QPushButton{
Q_OBJECT
public:
Piece();
};
#endif // PIECE_H
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:
#ifndef PIECE_H
#define PIECE_H
#include <QPushButton>
#include <QMouseEvent>
class Piece : QPushButton{
Q_OBJECT
public:
Piece();
};
#endif // PIECE_H