View Full Version : Buttons in Graphics Scene

28th November 2007, 18:06
Is there any way to make push buttons in graphics scene ??
Actually I wanted to represent a remote for camera in GUI. I thought it would be easier using QGraphicsItems,,, but I dont get the feel of button for graphics item.

Other way is to mask a pushbutton... but that will allow me to have a certain for a single pushbutton ... what I need is to place several buttons in the remote as pushbuttons.

any suggestions to achieve this ??

28th November 2007, 18:33
If yu don't need anything funky, I wouldn't use the graphics view framework for this. But if you want to use the framework, you can have a custom item that will use QStyle to draw the looks of a button. Other alternatives are using pixmap items for buttons or waiting for Qt 4.4 to use widgets on canvas.

28th November 2007, 18:44
i dont anything funky... what i want is to place many buttons in a widget.
or there some way where i can use bitmap mask for remote control...and make small regions in the widget as buttons ?? how can i achieve the functionality using widgets / pushbuttons ??

28th November 2007, 20:24
You can use stylesheets to style your buttons, I think it'll be as simple as can be. You might also set icons on buttons (toolbuttons) and make the buttons flat (autoRaise property set to true). This way you'll be able to represent buttons as images and still let the user know they are buttons when you hover mouse over them. In either case prefer using toolbuttons over pushbuttons.