gbmtoday
14th January 2010, 22:41
Hi there
I have QGraphicsRectItem and I want to resize it , but I can't.
I tried this , but it doesnt work
QRectF rect ( player->shape()->pos().x() ,
(player->shape()->pos().y()+WINDOW_END_H)/2.0,
PLAYER_WIDTH_P,
PLAYER_HEIGHT_P/2.0);
player->shape()->setRect(rect);
player->shape() returns a QGraphicsRectItem *
I just want to change the hight of the rect to a half .
I tried this , too
player->shape()->rect().setHeight(player->shape()->rect().height() / 2.0 );
It doesnt work too .
Do you know what is the problem?
I have QGraphicsRectItem and I want to resize it , but I can't.
I tried this , but it doesnt work
QRectF rect ( player->shape()->pos().x() ,
(player->shape()->pos().y()+WINDOW_END_H)/2.0,
PLAYER_WIDTH_P,
PLAYER_HEIGHT_P/2.0);
player->shape()->setRect(rect);
player->shape() returns a QGraphicsRectItem *
I just want to change the hight of the rect to a half .
I tried this , too
player->shape()->rect().setHeight(player->shape()->rect().height() / 2.0 );
It doesnt work too .
Do you know what is the problem?