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?

Qt Code:
  1. QPushButton *btn = new QPushButton("click me",0);
  2. style = "QPushButton { ";
  3. style += "background: url(:/images/btn-orange-normal.png);";
  4. style += "background-repeat: repeat-n; border-width: 0px; border-style: none;";
  5.  
  6. /*
  7. I would like to add something like:
  8. style += "width: background.width; height: background.height"
  9. */
  10.  
  11. style += "}";
  12. btn->setStyleSheet(style);
To copy to clipboard, switch view to plain text mode 

Tx a lot,