It does a matter, because after the constructor the sizeHint() function is called.
The sizeHint() function should return the size of the image, otherwise the function returns 0x0 (width x height). At this point the sizeHint() returns 0x0, because the image is defined after the sizeHint() call.
So if i call a function then the following are done:
Qt Code:
MyButton(); sizeHint()To copy to clipboard, switch view to plain text mode
I need to set the image before the sizeHint() function is called.
So I thought the best way is the constructor.
Regards
NoRulez
Bookmarks