4 # |
4 # |
5 |
5 |
6 """ |
6 """ |
7 Module implementing the icon editor grid. |
7 Module implementing the icon editor grid. |
8 """ |
8 """ |
|
9 |
|
10 from __future__ import unicode_literals # __IGNORE_WARNING__ |
9 |
11 |
10 from PyQt4.QtCore import pyqtSignal, Qt, QPoint, QRect, QSize |
12 from PyQt4.QtCore import pyqtSignal, Qt, QPoint, QRect, QSize |
11 from PyQt4.QtGui import QUndoCommand, QImage, QWidget, QColor, QPixmap, QSizePolicy, \ |
13 from PyQt4.QtGui import QUndoCommand, QImage, QWidget, QColor, QPixmap, QSizePolicy, \ |
12 QUndoStack, qRgba, QPainter, QApplication, QCursor, QBrush, QDialog, qGray, qAlpha |
14 QUndoStack, qRgba, QPainter, QApplication, QCursor, QBrush, QDialog, qGray, qAlpha |
13 |
15 |
27 @param grid reference to the icon editor grid (IconEditorGrid) |
29 @param grid reference to the icon editor grid (IconEditorGrid) |
28 @param text text for the undo command (string) |
30 @param text text for the undo command (string) |
29 @param oldImage copy of the icon before the changes were applied (QImage) |
31 @param oldImage copy of the icon before the changes were applied (QImage) |
30 @param parent reference to the parent command (QUndoCommand) |
32 @param parent reference to the parent command (QUndoCommand) |
31 """ |
33 """ |
32 super().__init__(text, parent) |
34 super(IconEditCommand, self).__init__(text, parent) |
33 |
35 |
34 self.__grid = grid |
36 self.__grid = grid |
35 self.__imageBefore = QImage(oldImage) |
37 self.__imageBefore = QImage(oldImage) |
36 self.__imageAfter = None |
38 self.__imageAfter = None |
37 |
39 |
112 """ |
114 """ |
113 Constructor |
115 Constructor |
114 |
116 |
115 @param parent reference to the parent widget (QWidget) |
117 @param parent reference to the parent widget (QWidget) |
116 """ |
118 """ |
117 super().__init__(parent) |
119 super(IconEditorGrid, self).__init__(parent) |
118 |
120 |
119 self.setAttribute(Qt.WA_StaticContents) |
121 self.setAttribute(Qt.WA_StaticContents) |
120 self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) |
122 self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) |
121 |
123 |
122 self.__curColor = Qt.black |
124 self.__curColor = Qt.black |