I'm using StyleSheets under QT 4.5 in my app, and most things work (aside from a few quirks)... but I haven't figured out how to get an icon loaded into a QToolButton derived class.

in my c++ code:

Qt Code:
  1. class myToolButton : public QToolButton
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6. myToolButton ( QWidget *pParent = 0 ) : QToolButton(pParent) {}
  7. };
To copy to clipboard, switch view to plain text mode 



and my stylesheet css:
Qt Code:
  1. myToolButton {
  2. border: none;
  3. min-height: 2px;
  4. min-width: 2px;
  5. width: 16px;
  6. height: 16px;
  7. icon-size: 13px, 13px;
  8. image : url (styles/cream/mybtn_up.png);
  9. }
  10. myToolButton:hover {
  11. image : url (styles/cream/mybtn_hover.png);
  12. }
  13. myToolButton:pressed{
  14. image : url (styles/cream/mybtn_pressed.png);
  15. }
To copy to clipboard, switch view to plain text mode 


but the images never show. Is it not possible to do this with QT StyleSheets yet? Or am I missing something?


I'd really appreciate any help,

steb.