Package pyforms :: Package gui :: Package Controls :: Module ControlFilesTree |
[hide private]
[frames] | no frames]

# Source Code for Module pyforms.gui.Controls.ControlFilesTree

     1  #!/usr/bin/python
     2  # -*- coding: utf-8 -*-
     3
     4  __author__      = "Ricardo Ribeiro"
     5  __credits__     = ["Ricardo Ribeiro"]
     6  __license__     = "MIT"
     7  __version__     = "0.0"
     8  __maintainer__  = "Ricardo Ribeiro"
     9  __email__       = "ricardojvr@gmail.com"
    10  __status__      = "Development"
    11
    12
    13  from pyforms.gui.Controls.ControlBase import ControlBase
    14  import pyforms.Utils.tools as tools
    15  from PyQt4 import uic
    16  from PyQt4 import QtGui, QtCore
    17
    18 -class ControlFilesTree(ControlBase):
    19
    20 -    def initForm(self):
    21          self._form = QtGui.QTreeView()
    22
    23      @property
    24 -    def value(self): return self._value
    25
    26      @value.setter
    27 -    def value(self, value):
    28          ControlBase.value.fset(self,value)
    29          model = QtGui.QFileSystemModel(parent=None)
    30          self._form.setModel(model)
    31          model.setRootPath(QtCore.QDir.currentPath())
    32
    33          self._form.setRootIndex(model.setRootPath(value))
    34
    35
    36          self._form.setIconSize(QtCore.QSize(32,32))
    37