码迷,mamicode.com
首页 > 其他好文 > 详细

pyqt columnView例子学习

时间:2014-08-05 21:56:20      阅读:758      评论:0      收藏:0      [点我收藏+]

标签:blog   http   io   2014   ar   log   python   res   

# -*- coding: utf-8 -*-

# python:2.x

__author__ = ‘Administrator‘

from PyQt4.QtGui import  *

from PyQt4.Qt import *

from PyQt4.QtCore import *

import sys

class Tree(QColumnView):

    def __init__(self,parnet=None,*args):

        super(Tree,self).__init__(parnet,*args)

        mode=QStandardItemModel()

        name=QStandardItem(‘name‘)

        firstName=QStandardItem(‘firstname‘)

        lastName=QStandardItem(‘lastname‘)

        name.appendRow(firstName)

        name.appendRow(lastName)

        mode.appendRow(name)

        john=QStandardItem(‘John‘)

        smit=QStandardItem(‘smith‘)

        firstName.appendRow(john)

        lastName.appendRow(smit)

        address=QStandardItem(‘address‘)

        street=QStandardItem(‘street‘)

        address.appendRow(street)

        street.appendRow(address)

        columview=QColumnView(self)

        columview.setModel(mode)

app =QApplication(sys.argv)

x = Tree()

x.show()

sys.exit(app.exec_())

如图:bubuko.com,布布扣

pyqt columnView例子学习,布布扣,bubuko.com

pyqt columnView例子学习

标签:blog   http   io   2014   ar   log   python   res   

原文地址:http://www.cnblogs.com/mhxy13867806343/p/3892908.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!