Somehow I knew you would ask that question
Of course this causes a slight memory leak if you don't count instances of your class. An alternative is to have those pixmaps directly in the class as regular members, only that it will have a bigger memory footprint.Qt Code:
class x{ static QPimxap *p1; public x(){ if(!p1){ } } }; To copy to clipboard, switch view to plain text mode
BTW. It's not an improper example - you simply don't like it.
I've been playing around with the new stylesheet thing and it makes everything much simpler. (The below is a stylesheet, not c++)
Qt Code:
image: url(:/images/checkbox_unchecked.png); } image: url(:/images/checkbox_checked.png); }To copy to clipboard, switch view to plain text mode
This is implemented with qApp->setStyleSheet() globally or with myCheckbox->setStyleSheet() for a particular checkbox. Also, check out the Style Sheet Example
Bookmarks