Exemplo n.º 1
0
 def setGeometry(self, rect):
     QLayout.setGeometry(self, rect)
     if self.isEmpty():
         return
     self.__data.numColumns = self.columnsForWidth(rect.width())
     self.__data.numRows = self.itemCount() / self.__data.numColumns
     if self.itemCount() % self.__data.numColumns:
         self.__data.numRows += 1
     itemGeometries = self.layoutItems(rect, self.__data.numColumns)
     for it, geo in zip(self.__data.itemList, itemGeometries):
         it.setGeometry(geo)
Exemplo n.º 2
0
 def setGeometry(self, rect):
     QLayout.setGeometry(self, rect)
     if self.isEmpty():
         return
     self.__data.numColumns = self.columnsForWidth(rect.width())
     self.__data.numRows = self.itemCount()/self.__data.numColumns
     if self.itemCount() % self.__data.numColumns:
         self.__data.numRows += 1
     itemGeometries = self.layoutItems(rect, self.__data.numColumns)
     for it, geo in zip(self.__data.itemList, itemGeometries):
         it.setGeometry(geo)
Exemplo n.º 3
0
 def setGeometry(self, rect):
     """
     Reorganizes columns and rows and resizes managed items within a 
     rectangle.
     """
     QLayout.setGeometry(self, rect)
     if self.isEmpty():
         return
     self.__data.numColumns = self.columnsForWidth(rect.width())
     self.__data.numRows = self.itemCount()/self.__data.numColumns
     if self.itemCount() % self.__data.numColumns:
         self.__data.numRows += 1
     itemGeometries = self.layoutItems(rect, self.__data.numColumns)
     for it, geo in zip(self.__data.itemList, itemGeometries):
         it.setGeometry(geo)
Exemplo n.º 4
0
 def __init__(self, *args):
     self.__data = None
     parent = None
     margin = 0
     spacing = -1
     if len(args) in (2, 3):
         parent, margin = args[:2]
         if len(args) == 3:
             spacing = args[-1]
     elif len(args) == 1:
         if isinstance(args[0], int):
             spacing, = args
         else:
             parent, = args
     elif len(args) != 0:
         raise TypeError("%s() takes 0, 1, 2 or 3 argument(s) (%s given)"\
                         % (self.__class__.__name__, len(args)))
     QLayout.__init__(self, parent)
     self.__data = QwtDynGridLayout_PrivateData()
     self.setSpacing(spacing)
     self.setContentsMargins(margin, margin, margin, margin)
Exemplo n.º 5
0
 def invalidate(self):
     """Invalidate all internal caches"""
     self.__data.isDirty = True
     QLayout.invalidate(self)
Exemplo n.º 6
0
 def invalidate(self):
     self.__data.isDirty = True
     QLayout.invalidate(self)
Exemplo n.º 7
0
 def invalidate(self):
     self.__data.isDirty = True
     QLayout.invalidate(self)