329 Public method to adjust the scene size to the diagram size. |
329 Public method to adjust the scene size to the diagram size. |
330 |
330 |
331 @param limit flag indicating to limit the scene to the |
331 @param limit flag indicating to limit the scene to the |
332 initial size (boolean) |
332 initial size (boolean) |
333 """ |
333 """ |
334 super(UMLGraphicsView, self).autoAdjustSceneSize(limit=limit) |
334 super().autoAdjustSceneSize(limit=limit) |
335 self.__checkSizeActions() |
335 self.__checkSizeActions() |
336 |
336 |
337 def saveImage(self): |
337 def saveImage(self): |
338 """ |
338 """ |
339 Public method to handle the save context menu entry. |
339 Public method to handle the save context menu entry. |
360 " Overwrite it?</p>").format(fname), |
360 " Overwrite it?</p>").format(fname), |
361 icon=E5MessageBox.Warning) |
361 icon=E5MessageBox.Warning) |
362 if not res: |
362 if not res: |
363 return |
363 return |
364 |
364 |
365 success = super(UMLGraphicsView, self).saveImage( |
365 success = super().saveImage( |
366 fname, QFileInfo(fname).suffix().upper()) |
366 fname, QFileInfo(fname).suffix().upper()) |
367 if not success: |
367 if not success: |
368 E5MessageBox.critical( |
368 E5MessageBox.critical( |
369 self, |
369 self, |
370 self.tr("Save Diagram"), |
370 self.tr("Save Diagram"), |
432 if printerName: |
432 if printerName: |
433 printer.setPrinterName(printerName) |
433 printer.setPrinterName(printerName) |
434 |
434 |
435 printDialog = QPrintDialog(printer, self) |
435 printDialog = QPrintDialog(printer, self) |
436 if printDialog.exec(): |
436 if printDialog.exec(): |
437 super(UMLGraphicsView, self).printDiagram( |
437 super().printDiagram( |
438 printer, self.diagramName) |
438 printer, self.diagramName) |
439 |
439 |
440 def printPreviewDiagram(self): |
440 def printPreviewDiagram(self): |
441 """ |
441 """ |
442 Public slot called to show a print preview of the diagram. |
442 Public slot called to show a print preview of the diagram. |
472 """ |
472 """ |
473 Private slot to generate a print preview. |
473 Private slot to generate a print preview. |
474 |
474 |
475 @param printer reference to the printer object (QPrinter) |
475 @param printer reference to the printer object (QPrinter) |
476 """ |
476 """ |
477 super(UMLGraphicsView, self).printDiagram(printer, self.diagramName) |
477 super().printDiagram(printer, self.diagramName) |
478 |
478 |
479 def setDiagramName(self, name): |
479 def setDiagramName(self, name): |
480 """ |
480 """ |
481 Public slot to set the diagram name. |
481 Public slot to set the diagram name. |
482 |
482 |
639 """ |
639 """ |
640 if evt.type() == QEvent.Type.Gesture: |
640 if evt.type() == QEvent.Type.Gesture: |
641 self.gestureEvent(evt) |
641 self.gestureEvent(evt) |
642 return True |
642 return True |
643 |
643 |
644 return super(UMLGraphicsView, self).event(evt) |
644 return super().event(evt) |
645 |
645 |
646 def gestureEvent(self, evt): |
646 def gestureEvent(self, evt): |
647 """ |
647 """ |
648 Protected method handling gesture events. |
648 Protected method handling gesture events. |
649 |
649 |