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

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

     1  from PyQt4 import uic, QtGui
     2  from pyforms.gui.Controls.ControlBase import ControlBase
     3
     4 -class ControlToolBox(ControlBase):
     5
     6 -    def initForm(self):
     7          self._form = QtGui.QToolBox()
     8          #self._form.setStyleSheet("""font-width: bold;border-radius: 3px;""")
     9          #self._form.setStyleSheet("""QWidget{background-color:black;}""")
    10          self.form.layout().setMargin(0)
    11          try:
    12              self.loadStyleSheetFile('style.css')
    13          except:pass
    14
    15
    16      @property
    17 -    def value(self): return self._value
    18
    19      @value.setter
    20 -    def value(self, value):
    21          ControlBase.label.fset(self, value);
    22
    23          for item in range(self.form.count(),-1, -1): self.form.removeItem(item)
    24
    25          for item in value:
    26              if isinstance(item, tuple):
    27                  widget = QtGui.QWidget();
    28                  layout = QtGui.QVBoxLayout();
    29                  layout.setMargin(0);
    30                  widget.setLayout( layout )
    31                  for e in item[1:]: widget.layout().addWidget( e.form )
    32                  self.form.addItem(widget, item[0])
    33              else:
    34                  self.form.addItem(item.form, item.label)
    35