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

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -