python - PyQt use QStyle.StandardPixmap with QIcon -


i using pyqt4 , want replace displayed icon in tree view:

if typeinfo == "light":     return qtgui.qicon(qtgui.qpixmap(":/light.png")) 

i use pyqt standard pixmap items (here), like:

if typeinfo == "light":     return qtgui.qstyle.sp_dirclosedicon 

but icon not displayed.

the documentation linked leads answer:

    return qtgui.qapp.style().standardicon(qtgui.qstyle.sp_dirclosedicon) 

Comments

Popular posts from this blog

r - Trouble relying on third party package imports in my package -

Payment information shows nothing in one page checkout page magento -