There is a very good question on Stack Overflow covering the extraction of the icon and turning it into a QPixmap, for PyQt4; I haven't ever tried it on PySide, but see if it works:
Best way to extract .ico from .exe and paint with PyQt?<http://stackoverflow.com/questions/1616342/best-way-to-extract-ico-from-exe-and-paint-with-pyqt> You can then turn the QPixmap into a QIcon if you need to. -- Chris On Thu, Feb 9, 2012 at 9:25 PM, Jun Koi <[email protected]> wrote: > hi, > > on Windows, i want to create an QIcon object. normally, it is possible > to create QIcon object with an image. but since my EXE file already > has an icon, i want to create QIcon with that. > > naturally, i can find the handle of the icon with following code: > > import win32api > hinst = win32api.GetModuleHandle(None) > hicon = win32gui.LoadImage(hinst, 0, win32con.IMAGE_ICON, 0, 0, > win32con.LR_DEFAULTSIZE) > > now, with hicon available, how can i use it to create QIcon object? > i looked at the QIcon doc, but it doesnt seem to have any method > working for this case. > > thanks a lot, > Jun > _______________________________________________ > PySide mailing list > [email protected] > http://lists.pyside.org/listinfo/pyside >
_______________________________________________ PySide mailing list [email protected] http://lists.pyside.org/listinfo/pyside
