import sys

import PyQt4.QtCore as QtCore
import PyQt4.QtGui as QtGui

if __name__ == '__main__':
    app = QtGui.QApplication(sys.argv)
    widget = QtGui.QWidget(None)
    layout = QtGui.QVBoxLayout(widget)
    tree = QtGui.QTreeView(widget)
    model = QtGui.QStandardItemModel()
    model.setHorizontalHeaderLabels(['First', 'Second'])
    tree.setModel(model)
    model.insertRow(0, [QtGui.QStandardItem('one'), QtGui.QStandardItem('two')])
    layout.addWidget(tree)
    widget.show()
    app.exec_()
