tags:

views:

20

answers:

1

I want to implement own QLayoutItem successor, but I can't provide QSizePolicy to layout, because no sizePolicy virtual method in QLayoutItem.

I looked into Qt sources and found that QLayout takes sizePolicy directly from QWidget avoiding QWidgetItem.

Why trolls have done so? And what I can do?

+1  A: 

Setting sizePolicy using setSizePolicy ( QSizePolicy ) inside the constructor of your class implementing QLayoutItem doesn't work ?

tibur
QLayoutItem has no setSizePolicy() method and sizePolicy() too :(
Navrocky
Does that mean you want to change the sizePolicy of the QWidget inside the layout ?
tibur
No. I write own control (QLayoutItem subclass, not a QWidget subclass) and want to put them into QLayout like a spacer. So, I cant provide sizePolicy to QLayout because it's a not QWidget..
Navrocky