PyQt
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from PyQt4 import QtCore,QtGui class paintArea(QtGui.QWidget): def __init__(self): super(paintArea, self).__init__() self.setMinimumWidth(500) self.setMinimumHeight(500) self.offscre…
ツリー構造のリストを、割りと簡単に作るサンプル。 タプルのリストからツリーアイテムを作る。タプル(k,v,n)の構造は、 k:ノードの名前 v:ノードの値 n:子ノード(のリスト) 以下ソース。 #!/usr/bin/env python # -*- coding: utf-8 -*- import sys, os, pp…
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from PyQt4.QtGui import * from PyQt4.QtCore import * def main(): app = QApplication(sys.argv) treeWidget = QTreeWidget() treeWidget.setColumnCount(1) items = [] child = [] for i in r…