Hi,
I have already used the designer to give a pushbutton the following stylesheet and tested that it works.
border-image: url(:/Images/a.png);
font: 75 13pt "Droid Serif [unknown]";
color:black;
}
border-image: url(:/Images/b.png);
color: darkred;
}
QPushButton {
border-image: url(:/Images/a.png);
font: 75 13pt "Droid Serif [unknown]";
color:black;
}
QPushButton:pressed {
border-image: url(:/Images/b.png);
color: darkred;
}
To copy to clipboard, switch view to plain text mode
I was trying to make sure that if a button is clicked it stays the in the pressed state in terms of color and background image and font so as to give the illusion that it is selected.
To do this i used the following command in my style sheet.
button
->setStylesheet
(setStyleSheet
(QString::fromUtf8("border-image: url(:/Images/b.png);color: darkred;font: 75 13pt;"));
button->setStylesheet(setStyleSheet(QString::fromUtf8("border-image: url(:/Images/b.png);color: darkred;font: 75 13pt;"));
To copy to clipboard, switch view to plain text mode
I dont know where to put the font name ie "Droid Serif [unknown]" as the quotation marks confuse the program if i do it in the same manner as the designer. I have tried appending it as a separate string but it doesnt work. Could anyone give me an example of using the setstylesheet with similar parameters and also setting the font.
Thanks
Bookmarks