Is there a way to determine if a QPushButton already has an icon, there seems to be no getIcon method.
Also how do you code that?
Is there a way to determine if a QPushButton already has an icon, there seems to be no getIcon method.
Also how do you code that?
Image Analysis Development Framework Using Qt (IADFUQ)
QPushButton is a QAbstractButton. QAbstractButton has a property icon. And QIcon has a method to see whether it's "null" or not.
J-P Nurmi
sincnarf (20th August 2007)
QAbstractButton::icon()
Edit: Great... lost another race to J-P...
sincnarf (20th August 2007)
In general, how do will I know what the parent class of widget is, I also would like to know what the parent class of QIcon is because there is not method for getting the file path of the image of the QIcon. Thanks to both of you as always, jpn and wysota
Image Analysis Development Framework Using Qt (IADFUQ)
It's mentioned at the beginning of class docs. For example at the beginning of QPushButton docs it says "Inherits QAbstractButton". One can also see a "list of all members, including inherited members" (link to this page is also at the beginning of class docs).
Actually QIcon doesn't inherit anything. An image can be loaded from a file, but once it has been added to QIcon, it has nothing to do with the file. QIcon can contain several images anyway.I also would like to know what the parent class of QIcon is because there is not method for getting the file path of the image of the QIcon.
You're watching too much Formula 1![]()
J-P Nurmi
Bookmarks