E4Graphics/E4GraphicsView.py

changeset 12
1d8dd9706f46
parent 0
de9c2efb9d02
child 13
1af94a91f439
equal deleted inserted replaced
11:b0996e4a289e 12:1d8dd9706f46
131 Protected method to calculate the minimum rectangle fitting the diagram. 131 Protected method to calculate the minimum rectangle fitting the diagram.
132 132
133 @param border border width to include in the calculation (integer) 133 @param border border width to include in the calculation (integer)
134 @return the minimum rectangle (QRectF) 134 @return the minimum rectangle (QRectF)
135 """ 135 """
136 startx = sys.maxint 136 startx = sys.maxsize
137 starty = sys.maxint 137 starty = sys.maxsize
138 endx = 0 138 endx = 0
139 endy = 0 139 endy = 0
140 items = self.filteredItems(self.scene().items()) 140 items = self.filteredItems(list(self.scene().items()))
141 for itm in items: 141 for itm in items:
142 rect = itm.sceneBoundingRect() 142 rect = itm.sceneBoundingRect()
143 itmEndX = rect.x() + rect.width() 143 itmEndX = rect.x() + rect.width()
144 itmEndY = rect.y()+ rect.height() 144 itmEndY = rect.y()+ rect.height()
145 itmStartX = rect.x() 145 itmStartX = rect.x()
167 @param border border width to include in the calculation (integer) 167 @param border border width to include in the calculation (integer)
168 @return the minimum size (QSizeF) 168 @return the minimum size (QSizeF)
169 """ 169 """
170 endx = 0 170 endx = 0
171 endy = 0 171 endy = 0
172 items = self.filteredItems(self.scene().items()) 172 items = self.filteredItems(list(self.scene().items()))
173 for itm in items: 173 for itm in items:
174 rect = itm.sceneBoundingRect() 174 rect = itm.sceneBoundingRect()
175 itmEndX = rect.x() + rect.width() 175 itmEndX = rect.x() + rect.width()
176 itmEndY = rect.y()+ rect.height() 176 itmEndY = rect.y()+ rect.height()
177 if endx <= itmEndX: 177 if endx <= itmEndX:

eric ide

mercurial