Hello,
I am loading a background image in a QPushButton and I would like to set the button width and height from the stylesheet with the background image width and height. Is it possible?
style = "QPushButton { ";
style += "background: url(:/images/btn-orange-normal.png);";
style += "background-repeat: repeat-n; border-width: 0px; border-style: none;";
/*
I would like to add something like:
style += "width: background.width; height: background.height"
*/
style += "}";
btn->setStyleSheet(style);
QPushButton *btn = new QPushButton("click me",0);
style = "QPushButton { ";
style += "background: url(:/images/btn-orange-normal.png);";
style += "background-repeat: repeat-n; border-width: 0px; border-style: none;";
/*
I would like to add something like:
style += "width: background.width; height: background.height"
*/
style += "}";
btn->setStyleSheet(style);
To copy to clipboard, switch view to plain text mode
Tx a lot,
Bookmarks