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);
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);
To copy to clipboard, switch view to plain text mode
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 );
player->shape()->rect().setHeight(player->shape()->rect().height() / 2.0 );
To copy to clipboard, switch view to plain text mode
It doesnt work too .
Do you know what is the problem?
Bookmarks