View Full Version : how to change the color of the frame

12th May 2009, 12:57
hi friends,
i need some suggestion to start designing my app ..

i am having a .png image , a pixmap in my window
and this window will receive signals every time ..
according to the received signals i have to change the color on the surrounding frame layer of the pixmap .....
i attached the picture how i wantt to change the color of the border of the image ... how can i change the border color around this image ....

12th May 2009, 13:04
if you have a frame surrounding your pixmap, something like this should work:

frame->setStyleSheet("border: 2px solid myColor");

u can change the value of myColor depending upon your requirements

12th May 2009, 13:09
thanks ...
i will try placing the pixmap in centre of the frame and then i will change the stylesheet background ... right aaa ..

12th May 2009, 13:20
can any one help me how to set a pixmap centered inside the frame ..... i try stylesheet in designer .. set background image .. but it is showing in tiled fashion ....

12th May 2009, 13:35
put QLabel in your frame, set your image as pixmap to that label, and alignment Center (HCenter | VCenter), with pixmap scaling to content turned off. You can do it all in Designer.

12th May 2009, 13:46
yes, its a good solution .... thank you very much ....