is this possible to have a tree-like structure of QObjects and (for example) QGraphicsWidgets ? I mean, I cannot write initialization Lists like these:
class MyButton : public QGraphicsWidget
{
Q_OBJECT
public:
MyButton(int buttonId, QObject *parent = 0) : QObject(parent)
{
}
and then, be like
myButton = new MyButton(id, myObject);
Should I do .setParent or what ?
Update: see actual assignment:
class myObject : public QObject
{
Q_OBJECT
public:
MyObject(QObject *parent = 0) : QObject(parent) {
}
MyButton *myButton;
void showButton(){
myButton = new MyButton(id, this); //no matching function for call to 'MyButton::MyButton(MyObject* const)'
//note: no known conversion for argument from 'MyObject* const' to 'QGraphicsObject*'
}
};