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

How to group boxplot outliers in gnuplot -

cakephp - simple blog with croogo -