PDA

View Full Version : Implementing Qtoolbar or customized toolbar with qgraphicsitem.



punitk
21st September 2010, 08:43
How to implement movable toolbar on QGraphicsItem having some buttons on it and the bar should not be included in the boundingRect of item?

The Toolbar should move with the Item in the view. The tool bar has to be placed at the bottom right of the item. 5212

Lykurg
21st September 2010, 08:53
I don't get you 100%: should it be a tool bar for one item or for the whole scene? If the former: have a look at QGraphicsItemGroup (automatic moving of both items) as a starting point. But you have to take care about all things. There is less Qt can help you with.

Also you can get ideas from the example about item handles as the are in various Qt books.

punitk
21st September 2010, 09:32
Yes It has to be tool bar for one Item. Well u are saying my tool bar should also be a qgraphicsitem and i should group my item with this using QGraphicsItemGroup.It seems that it will work and i will get automatic movement.

But there could be one more issue if more than one item is selected. Sorry I didn't mention that there could be more than one item. And my requirement is that :
This toolbar will appear when a single ungrouped item is selected alone.