0

Hi everyone

I have system that has classes derived from QGraphicsWidget. I manage derived class objects in layouts on QGraphicsScene. Now I need a compound item that contain two or more QGraphicsWidget in it and also I need to put that item inside my layout. So I choose QGraphicsItemGroup and write I class like this.

class CompositeItem : public QGraphicsItemGroup,public QGraphicsLayoutItem
{   
   ...  
};

I only implemented sizeHint function again. When add CompositeItem instance to layout it does not shown. What may cause this? Where I made wrong?

Edited by onurozcelik: presentation

2
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by onurozcelik
0

I think you want to inherit the constructors too.

What do you really mean by that?

0

I really don't know for sure if that's what you want to do but if you're trying to build a derived object out of several classes you should initialize the inherited constructors too.

0

I really don't know for sure if that's what you want to do but if you're trying to build a derived object out of several classes you should initialize the inherited constructors too.

You may be right. I will give it a try!

0

I initialized derived constructors. No success. But I figured out that problem is related with QGraphicsLayoutItem base class.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.