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:
{
Q_OBJECT
public:
};
class myToolButton : public QToolButton
{
Q_OBJECT
public:
myToolButton ( QWidget *pParent = 0 ) : QToolButton(pParent) {}
};
To copy to clipboard, switch view to plain text mode
and my stylesheet css:
myToolButton {
border: none;
min-height: 2px;
min-width: 2px;
width: 16px;
height: 16px;
icon-size: 13px, 13px;
image : url (styles/cream/mybtn_up.png);
}
myToolButton:hover {
image : url (styles/cream/mybtn_hover.png);
}
myToolButton:pressed{
image : url (styles/cream/mybtn_pressed.png);
}
myToolButton {
border: none;
min-height: 2px;
min-width: 2px;
width: 16px;
height: 16px;
icon-size: 13px, 13px;
image : url (styles/cream/mybtn_up.png);
}
myToolButton:hover {
image : url (styles/cream/mybtn_hover.png);
}
myToolButton:pressed{
image : url (styles/cream/mybtn_pressed.png);
}
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.
Bookmarks