--- a/src/eric7/EricWidgets/EricMapWidget.py Tue Dec 19 11:04:03 2023 +0100 +++ b/src/eric7/EricWidgets/EricMapWidget.py Tue Dec 19 19:57:08 2023 +0100 @@ -21,7 +21,8 @@ """ Constructor - @param parent reference to the parent widget (QWidget) + @param parent reference to the parent widget + @type QWidget """ super().__init__(parent) self.setAttribute(Qt.WidgetAttribute.WA_OpaquePaintEvent) @@ -84,7 +85,8 @@ """ Public method to set the widget width. - @param width widget width (integer) + @param width widget width + @type int """ if width != self.__width: self.__width = max(6, width) # minimum width 6 pixels @@ -95,7 +97,8 @@ """ Public method to get the widget's width. - @return widget width (integer) + @return widget width + @rtype int """ return self.__width @@ -128,8 +131,10 @@ """ Public method to set the line (indicator) dimensions. - @param border border width on each side in x-direction (integer) - @param height height of the line in pixels (integer) + @param border border width on each side in x-direction + @type int + @param height height of the line in pixels + @type int """ if border != self.__lineBorder or height != self.__lineHeight: self.__lineBorder = max(1, border) # min border 1 pixel @@ -140,7 +145,8 @@ """ Public method to get the line (indicator) dimensions. - @return tuple with border width (integer) and line height (integer) + @return tuple with border width (integer) and line height + @rtype int """ return self.__lineBorder, self.__lineHeight @@ -148,7 +154,8 @@ """ Public method to set the enabled state. - @param enable flag indicating the enabled state (boolean) + @param enable flag indicating the enabled state + @type bool """ if enable != self.__enabled: self.__enabled = enable @@ -159,7 +166,8 @@ """ Public method to check the enabled state. - @return flag indicating the enabled state (boolean) + @return flag indicating the enabled state + @rtype bool """ return self.__enabled @@ -167,7 +175,8 @@ """ Public method to set the widget background color. - @param color color for the background (QColor) + @param color color for the background + @type QColor """ if color != self.__backgroundColor: self.__backgroundColor = color @@ -178,7 +187,8 @@ """ Public method to get the background color. - @return background color (QColor) + @return background color + @rtype QColor """ return QColor(self.__backgroundColor) @@ -186,7 +196,8 @@ """ Public method to give an indication about the preferred size. - @return preferred size (QSize) + @return preferred size + @rtype QSize """ return QSize(self.__width, 0) @@ -194,7 +205,8 @@ """ Protected method to handle a paint event. - @param event paint event (QPaintEvent) + @param event paint event + @type QPaintEvent """ # step 1: fill the whole painting area painter = QPainter(self) @@ -219,7 +231,8 @@ Note: This method should be implemented by subclasses. - @param painter reference to the painter object (QPainter) + @param painter reference to the painter object + @type QPainter """ pass @@ -227,7 +240,8 @@ """ Protected method to handle a mouse button press. - @param event reference to the mouse event (QMouseEvent) + @param event reference to the mouse event + @type QMouseEvent """ if event.button() == Qt.MouseButton.LeftButton and self._controller: vsb = self._controller.verticalScrollBar() @@ -239,7 +253,8 @@ """ Protected method to handle a mouse moves. - @param event reference to the mouse event (QMouseEvent) + @param event reference to the mouse event + @type QMouseEvent """ if event.buttons() & Qt.MouseButton.LeftButton and self._controller: vsb = self._controller.verticalScrollBar() @@ -250,7 +265,8 @@ """ Protected slot handling mouse wheel events. - @param event reference to the wheel event (QWheelEvent) + @param event reference to the wheel event + @type QWheelEvent """ isVertical = event.angleDelta().x() == 0 if ( @@ -292,8 +308,9 @@ Public method to determine the scrollbar's scale factor. @param slider flag indicating to calculate the result for the slider - (boolean) - @return scale factor (float) + @type bool + @return scale factor + @rtype float """ if self._controller: delta = 0 if slider else 2 @@ -308,10 +325,12 @@ """ Public method to convert a scrollbar value into a position. - @param value value to convert (integer) + @param value value to convert + @type int @param slider flag indicating to calculate the result for the slider - (boolean) - @return position (integer) + @type bool + @return position + @rtype int """ if self._controller: offset = 0 if slider else 1 @@ -324,10 +343,13 @@ """ Public method to convert a position into a scrollbar value. - @param position scrollbar position to convert (integer) + @param position scrollbar position to convert + @type int @param slider flag indicating to calculate the result for the slider - (boolean) - @return scrollbar value (integer) + + @type bool + @return scrollbar value + @rtype int """ if self._controller: offset = 0 if slider else 1 @@ -342,8 +364,10 @@ """ Public method to generate an indicator rectangle. - @param position indicator position (integer) - @return indicator rectangle (QRect) + @param position indicator position + @type int + @return indicator rectangle + @rtype QRect """ return QRect( self.__lineBorder, @@ -356,8 +380,10 @@ """ Private method to generate the slider rectangle. - @param scrollbar reference to the vertical scrollbar (QScrollBar) - @return slider rectangle (QRect) + @param scrollbar reference to the vertical scrollbar + @type QScrollBar + @return slider rectangle + @rtype QRect """ pos1 = self.value2Position(scrollbar.value(), slider=True) pos2 = self.value2Position(