986 """ |
986 """ |
987 Public slot to resize the image. |
987 Public slot to resize the image. |
988 """ |
988 """ |
989 from .IconSizeDialog import IconSizeDialog |
989 from .IconSizeDialog import IconSizeDialog |
990 dlg = IconSizeDialog(self.__image.width(), self.__image.height()) |
990 dlg = IconSizeDialog(self.__image.width(), self.__image.height()) |
991 res = dlg.exec_() |
991 res = dlg.exec() |
992 if res == QDialog.Accepted: |
992 if res == QDialog.Accepted: |
993 newWidth, newHeight = dlg.getData() |
993 newWidth, newHeight = dlg.getData() |
994 if ( |
994 if ( |
995 newWidth != self.__image.width() or |
995 newWidth != self.__image.width() or |
996 newHeight != self.__image.height() |
996 newHeight != self.__image.height() |
1009 """ |
1009 """ |
1010 Public slot to generate a new, empty image. |
1010 Public slot to generate a new, empty image. |
1011 """ |
1011 """ |
1012 from .IconSizeDialog import IconSizeDialog |
1012 from .IconSizeDialog import IconSizeDialog |
1013 dlg = IconSizeDialog(self.__image.width(), self.__image.height()) |
1013 dlg = IconSizeDialog(self.__image.width(), self.__image.height()) |
1014 res = dlg.exec_() |
1014 res = dlg.exec() |
1015 if res == QDialog.Accepted: |
1015 if res == QDialog.Accepted: |
1016 width, height = dlg.getData() |
1016 width, height = dlg.getData() |
1017 img = QImage(width, height, QImage.Format_ARGB32) |
1017 img = QImage(width, height, QImage.Format_ARGB32) |
1018 img.fill(qRgba(0, 0, 0, 0)) |
1018 img.fill(qRgba(0, 0, 0, 0)) |
1019 self.setIconImage(img) |
1019 self.setIconImage(img) |