--- a/src/eric7/IconEditor/IconEditorWindow.py Wed Dec 20 11:06:38 2023 +0100 +++ b/src/eric7/IconEditor/IconEditorWindow.py Wed Dec 20 14:58:58 2023 +0100 @@ -47,13 +47,18 @@ """ Constructor - @param fileName name of a file to load on startup (string) - @param parent parent widget of this window (QWidget) + @param fileName name of a file to load on startup + @type str + @param parent parent widget of this window + @type QWidget @param fromEric flag indicating whether it was called from within - eric (boolean) + eric + @type bool @param initShortcutsOnly flag indicating to just initialize the - keyboard shortcuts (boolean) - @param project reference to the project object (Project) + keyboard shortcuts + @type bool + @param project reference to the project object + @type Project """ super().__init__(parent) self.setObjectName("eric7_icon_editor") @@ -1126,9 +1131,10 @@ """ Protected event handler for the close event. - @param evt the close event (QCloseEvent) - <br />This event is simply accepted after the history has been - saved and all window references have been deleted. + @param evt the close event + @type QCloseEvent + <br />This event is simply accepted after the history has been + saved and all window references have been deleted. """ if self.__maybeSave(): self.__editor.shutdown() @@ -1198,7 +1204,8 @@ """ Private slot to save the icon. - @return flag indicating success (boolean) + @return flag indicating success + @rtype bool """ if not self.__fileName: return self.__saveIconAs() @@ -1209,7 +1216,8 @@ """ Private slot to save the icon with a new name. - @return flag indicating success (boolean) + @return flag indicating success + @rtype bool """ if ( not self.__lastSavePath @@ -1271,7 +1279,8 @@ """ Private method to load an icon file. - @param fileName name of the icon file to load (string). + @param fileName name of the icon file to load + @type str """ img = QImage(fileName) if img.isNull(): @@ -1288,8 +1297,10 @@ """ Private method to save to the given file. - @param fileName name of the file to save to (string) - @return flag indicating success (boolean) + @param fileName name of the file to save to + @type str + @return flag indicating success + @rtype bool """ img = self.__editor.iconImage() res = img.save(fileName) @@ -1318,7 +1329,8 @@ """ Private method to register the file name of the current file. - @param fileName name of the file to register (string) + @param fileName name of the file to register + @type str """ self.__fileName = fileName @@ -1338,8 +1350,10 @@ """ Private method to return the filename part of the given path. - @param fullFileName full pathname of the given file (string) - @return filename part (string) + @param fullFileName full pathname of the given file + @type str + @return filename part + @rtype str """ return pathlib.Path(fullFileName).name @@ -1347,7 +1361,8 @@ """ Private method to ask the user to save the file, if it was modified. - @return flag indicating, if it is ok to continue (boolean) + @return flag indicating, if it is ok to continue + @rtype bool """ if self.__editor.isDirty(): ret = EricMessageBox.okToClearData( @@ -1364,8 +1379,10 @@ """ Public method to set the last open and save paths. - @param openPath least recently used open path (string) - @param savePath least recently used save path (string) + @param openPath least recently used open path + @type str + @param savePath least recently used save path + @type str """ if openPath: self.__lastOpenPath = openPath @@ -1383,6 +1400,7 @@ Private slot to handle the modificationChanged signal. @param m modification status + @type bool """ self.setWindowModified(m) self.__checkActions() @@ -1391,8 +1409,10 @@ """ Private slot to show the current cursor position. - @param x x-coordinate (integer) - @param y y-coordinate (integer) + @param x x-coordinate + @type int + @param y y-coordinate + @type int """ self.__sbPos.setText("X: {0:d} Y: {1:d}".format(x + 1, y + 1)) @@ -1400,8 +1420,10 @@ """ Private slot to show the current icon size. - @param w width of the icon (integer) - @param h height of the icon (integer) + @param w width of the icon + @type int + @param h height of the icon + @type int """ self.__sbSize.setText("Size: {0:d} x {1:d}".format(w, h)) @@ -1470,7 +1492,8 @@ """ Protected method to handle wheel events. - @param evt reference to the wheel event (QWheelEvent) + @param evt reference to the wheel event + @type QWheelEvent """ if evt.modifiers() & Qt.KeyboardModifier.ControlModifier: delta = evt.angleDelta().y() @@ -1487,8 +1510,10 @@ """ Public method handling events. - @param evt reference to the event (QEvent) - @return flag indicating, if the event was handled (boolean) + @param evt reference to the event + @type QEvent + @return flag indicating, if the event was handled + @rtype bool """ if evt.type() == QEvent.Type.Gesture: self.gestureEvent(evt)