Is it possible to draw a grid on a QGraphicsItem?
And
Is it possible to resize that grid with the help of any events?
Could use all the help i get.
thnx.
Is it possible to draw a grid on a QGraphicsItem?
And
Is it possible to resize that grid with the help of any events?
Could use all the help i get.
thnx.
Could u show some code snippets or point me in the direction as to how to go about doin so?
I want to draw a resizable grid on QGraphicsItem and be able to place small icons in grid cells.
Thanks for ur response wysota!
Is there a specific reason why you don't want to use, for example, QGraphicsScene::drawBackground() to draw the grid and then place the items as individual QGraphicsItems on the scene?
No, coz thats not what I want to achieve.
I have set a QGraphicsScene as a bgrnd, and for some specific reasons, I want to add an QGraphicsItem on that using
scene->addItem(item).
And I want to b able to draw d grid on that item and not on the scene. I hope I hv put down my doubt clearly.
Can use all the help.
Thnx.
If this suits your needs, the easiest way is probaby to create a subclass of QGraphicsItem, reimplement paint() and simply draw the grid from there.
Make your grid a child item of the item you want it to be drawn on. Make the icons child items of the grid item.
I have managed to draw a grid on QGraphicsSvgItem.
Now what i want to do is grab a lower right corner of that grid with mouse click and resize it.
if you could tell me how should i go about it !
Should i try to handle a resizeEvent or make the grid shrik and expand on mouseClickDrag or anything like that??
Please shed some light on this aspect as well.
Thanks.
If you want me to guide you step by step to implement your program then that's not going to happen. Learn a tool first before you start using it.
Bookmarks