2403:e3d7a861547c | 2404:cba0ff902c2b |
---|---|
12 QUndoStack, qRgba, QPainter, QApplication, QCursor, QBrush, QDialog, qGray, qAlpha | 12 QUndoStack, qRgba, QPainter, QApplication, QCursor, QBrush, QDialog, qGray, qAlpha |
13 | 13 |
14 from E5Gui import E5MessageBox | 14 from E5Gui import E5MessageBox |
15 | 15 |
16 from .cursors import cursors_rc # __IGNORE_WARNING__ | 16 from .cursors import cursors_rc # __IGNORE_WARNING__ |
17 | |
18 from .IconSizeDialog import IconSizeDialog | |
19 | 17 |
20 | 18 |
21 class IconEditCommand(QUndoCommand): | 19 class IconEditCommand(QUndoCommand): |
22 """ | 20 """ |
23 Class implementing an undo command for the icon editor. | 21 Class implementing an undo command for the icon editor. |
942 | 940 |
943 def editResize(self): | 941 def editResize(self): |
944 """ | 942 """ |
945 Public slot to resize the image. | 943 Public slot to resize the image. |
946 """ | 944 """ |
945 from .IconSizeDialog import IconSizeDialog | |
947 dlg = IconSizeDialog(self.__image.width(), self.__image.height()) | 946 dlg = IconSizeDialog(self.__image.width(), self.__image.height()) |
948 res = dlg.exec_() | 947 res = dlg.exec_() |
949 if res == QDialog.Accepted: | 948 if res == QDialog.Accepted: |
950 newWidth, newHeight = dlg.getData() | 949 newWidth, newHeight = dlg.getData() |
951 if newWidth != self.__image.width() or newHeight != self.__image.height(): | 950 if newWidth != self.__image.width() or newHeight != self.__image.height(): |
959 | 958 |
960 def editNew(self): | 959 def editNew(self): |
961 """ | 960 """ |
962 Public slot to generate a new, empty image. | 961 Public slot to generate a new, empty image. |
963 """ | 962 """ |
963 from .IconSizeDialog import IconSizeDialog | |
964 dlg = IconSizeDialog(self.__image.width(), self.__image.height()) | 964 dlg = IconSizeDialog(self.__image.width(), self.__image.height()) |
965 res = dlg.exec_() | 965 res = dlg.exec_() |
966 if res == QDialog.Accepted: | 966 if res == QDialog.Accepted: |
967 width, height = dlg.getData() | 967 width, height = dlg.getData() |
968 img = QImage(width, height, QImage.Format_ARGB32) | 968 img = QImage(width, height, QImage.Format_ARGB32) |