163 self.pixmapLabel.adjustSize() |
163 self.pixmapLabel.adjustSize() |
164 return True |
164 return True |
165 |
165 |
166 def getDiagramName(self): |
166 def getDiagramName(self): |
167 """ |
167 """ |
168 Method to retrieve a name for the diagram. |
168 Public method to retrieve a name for the diagram. |
169 |
169 |
170 @return name for the diagram |
170 @return name for the diagram |
171 """ |
171 """ |
172 return self.pixmapfile |
172 return self.pixmapfile |
173 |
173 |
174 def getStatus(self): |
174 def getStatus(self): |
175 """ |
175 """ |
176 Method to retrieve the status of the canvas. |
176 Public method to retrieve the status of the canvas. |
177 |
177 |
178 @return flag indicating a successful pixmap loading (boolean) |
178 @return flag indicating a successful pixmap loading (boolean) |
179 """ |
179 """ |
180 return self.status |
180 return self.status |
181 |
181 |
195 |
195 |
196 super(PixmapDiagram, self).wheelEvent(evt) |
196 super(PixmapDiagram, self).wheelEvent(evt) |
197 |
197 |
198 def event(self, evt): |
198 def event(self, evt): |
199 """ |
199 """ |
200 Protected method handling events. |
200 Public method handling events. |
201 |
201 |
202 @param evt reference to the event (QEvent) |
202 @param evt reference to the event (QEvent) |
203 @return flag indicating, if the event was handled (boolean) |
203 @return flag indicating, if the event was handled (boolean) |
204 """ |
204 """ |
205 if evt.type() == QEvent.Gesture: |
205 if evt.type() == QEvent.Gesture: |
251 break |
251 break |
252 return index |
252 return index |
253 |
253 |
254 def __doZoom(self, value): |
254 def __doZoom(self, value): |
255 """ |
255 """ |
256 Public method to set the zoom value in percent. |
256 Private method to set the zoom value in percent. |
257 |
257 |
258 @param value zoom value in percent (integer) |
258 @param value zoom value in percent (integer) |
259 """ |
259 """ |
260 oldValue = self.__zoom() |
260 oldValue = self.__zoom() |
261 if value != oldValue: |
261 if value != oldValue: |
292 """ |
292 """ |
293 self.__doZoom(PixmapDiagram.ZoomLevels[PixmapDiagram.ZoomLevelDefault]) |
293 self.__doZoom(PixmapDiagram.ZoomLevels[PixmapDiagram.ZoomLevelDefault]) |
294 |
294 |
295 def __zoom(self): |
295 def __zoom(self): |
296 """ |
296 """ |
297 Public method to get the current zoom factor in percent. |
297 Private method to get the current zoom factor in percent. |
298 |
298 |
299 @return current zoom factor in percent (integer) |
299 @return current zoom factor in percent (integer) |
300 """ |
300 """ |
301 return int(self.pixmapLabel.width() / |
301 return int(self.pixmapLabel.width() / |
302 self.pixmapLabel.pixmap().width() * 100.0) |
302 self.pixmapLabel.pixmap().width() * 100.0) |