PDA

View Full Version : Button icon and text



electronicboy
9th October 2009, 11:03
Hi all,

http://img59.imageshack.us/img59/363/65641611.jpg (http://img59.imageshack.us/i/65641611.jpg/)


I get screen shot like this

As follows:How can I do?

http://img8.imageshack.us/img8/1346/28350543.jpg (http://img8.imageshack.us/i/28350543.jpg/)

yogeshgokul
9th October 2009, 11:10
You can use style sheet.

QPushButton{
background-image: url(:/images/ImageNamepng)
background-position: top center;
}

nish
9th October 2009, 12:05
what you want to achieve.. the first one or the 2nd or both?

spirit
9th October 2009, 12:14
have a look at QToolButton::setToolButtonStyle.

electronicboy
9th October 2009, 14:23
sorry form my bat english
I write the name of the button config file
buttonsNames = stringToList(std::string("buttonsname"));

looks like this is the first image.

I like the image to obtain the second picture.

How should I follow a method?

electronicboy
9th October 2009, 22:27
Hi i don't edit my message and i must write this message as so sory

I want to showing picture and text in QPushButton. But text is showing right the picture. How can i show picture is top and text is buttom?

P.S: @spirit i don't used QToolButtonStyle. must i be include to library?