Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: None  |  size: 0.48 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # coding: utf-8
  2. from PySide.QtCore import *
  3. from PySide.QtGui  import *
  4.  
  5. import sys
  6.  
  7. class A(QMainWindow):
  8.         def __init__(self, parent=None):
  9.                 super(A, self).__init__(parent)
  10.                 a = QFileSystemModel(self)
  11.                 a.setRootPath("/home/linusio/Bilder/BildbasTecken/")
  12.                 b = QSortFilterProxyModel(self)
  13.                 b.setSourceModel(a)
  14.                
  15.                 v = QTreeView(self)
  16.                 v.setModel(b)
  17.                 self.setCentralWidget(v)
  18.  
  19. app = QApplication(sys.argv)
  20. m = A()
  21. m.show()
  22. app.exec_()
  23. print("hej")
  24. sys.exit()