aboutsummaryrefslogtreecommitdiffstats
path: root/examples/charts/pointselectionandmarkers/utilities.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2023-11-28 12:10:26 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2023-11-28 15:58:37 +0100
commitddc01a90175e90a7854be0d90bed25a902613e59 (patch)
tree26eecdea75c0f304a46880eec30720822439a34d /examples/charts/pointselectionandmarkers/utilities.py
parentca3a64c024ae817ca38b1df87123f341637c8bd4 (diff)
Examples: Fix some flake warnings
Mostly spacing related. Pick-to: 6.6 Change-Id: If0d5b25e1c60b7b216f970d1e57613f00bd04a37 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Diffstat (limited to 'examples/charts/pointselectionandmarkers/utilities.py')
-rw-r--r--examples/charts/pointselectionandmarkers/utilities.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/charts/pointselectionandmarkers/utilities.py b/examples/charts/pointselectionandmarkers/utilities.py
index 6b96d6e26..ee36e855a 100644
--- a/examples/charts/pointselectionandmarkers/utilities.py
+++ b/examples/charts/pointselectionandmarkers/utilities.py
@@ -6,6 +6,7 @@ from PySide6.QtCore import Qt
import rc_markers
+
def rectangle(point_type, image_size):
image = QImage(image_size, image_size, QImage.Format_RGB32)
painter = QPainter()
@@ -15,9 +16,11 @@ def rectangle(point_type, image_size):
painter.end()
return image
+
def triangle(point_type, image_size):
return QImage(point_type[3]).scaled(image_size, image_size)
+
def circle(point_type, image_size):
image = QImage(image_size, image_size, QImage.Format_ARGB32)
image.fill(QColor(0, 0, 0, 0))
@@ -32,6 +35,7 @@ def circle(point_type, image_size):
painter.end()
return image
+
_point_types = [("RedRectangle", rectangle, Qt.red),
("GreenTriangle", triangle, Qt.green, ":/images/green_triangle.png"),
("OrangeCircle", circle, QColor(255, 127, 80))]
@@ -40,12 +44,15 @@ _selected_point_types = [("BlueTriangle", triangle, Qt.blue, ":/images/blue_tria
("LavenderCircle", circle, QColor(147, 112, 219))]
_line_colors = [("Blue", QColor(65, 105, 225)), ("Black", Qt.black), ("Mint", QColor(70, 203, 155))]
+
def point_type(index):
return _point_types[index]
+
def selected_point_type(index):
return _selected_point_types[index]
+
def line_color(index):
return _line_colors[index]
@@ -53,6 +60,7 @@ def line_color(index):
def default_light_marker(image_size):
return rectangle(_point_types[0], image_size)
+
def default_selected_light_marker(image_size):
return triangle(_selected_point_types[0], image_size)
@@ -60,8 +68,10 @@ def default_selected_light_marker(image_size):
def get_point_representation(point_type, image_size):
return point_type[1](point_type, image_size)
+
def get_selected_point_representation(point_type, image_size):
return point_type[1](point_type, image_size)
+
def make_line_color(line_color):
return line_color[1]