#/usr/bin/env python
# -*- coding:utf8 -*-
from PyQt4 import Qt
def clickme():
model.item(0,0).setIcon(Qt.QIcon('2.jpg'))
app = Qt.QApplication([])
w = Qt.QWidget()
item = Qt.QStandardItem('text')
item.setIcon(Qt.QIcon('1.jpg'))
model = Qt.QStandardItemModel()
model.setHorizontalHeaderLabels([u'Заголовок'])
model.appendRow(item)
tree = Qt.QTreeView(w)
tree.setModel(model)
btn = Qt.QPushButton("Click me",w)
Qt.QObject.connect(btn,Qt.SIGNAL("clicked()"),clickme)
grid = Qt.QGridLayout(w)
grid.setMargin(0)
grid.addWidget(tree,0,0)
grid.addWidget(btn,1,0)
w.move(0,0)
w.show()
app.exec_()