From 09902f98547abebc239b442fb55103bf14eff974 Mon Sep 17 00:00:00 2001 From: David Nadlinger Date: Thu, 14 May 2026 12:32:55 +0100 Subject: [PATCH] Follow PyQt6 API changes in diverging-mode editor --- viscm/gui.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/viscm/gui.py b/viscm/gui.py index e527ae3..5be29ea 100644 --- a/viscm/gui.py +++ b/viscm/gui.py @@ -1185,7 +1185,7 @@ def __init__(self, figurecanvas, viscm_editor, parent=None): mainlayout.addLayout(min_slider_layout) if viscm_editor.cmtype == "diverging": - smoothness_slider = QtWidgets.QSlider(Qt.Horizontal) + smoothness_slider = QtWidgets.QSlider(Qt.Orientation.Horizontal) # We want the slider to vary filter_k exponentially between 5 and # 1000. So it should go from [log10(5), log10(1000)] # which is about [0.699, 3.0] @@ -1194,15 +1194,15 @@ def __init__(self, figurecanvas, viscm_editor, parent=None): # to deal with this. smoothness_slider.setMinimum(699) smoothness_slider.setMaximum(3000) - smoothness_slider.setTickPosition(QtWidgets.QSlider.NoTicks) + smoothness_slider.setTickPosition(QtWidgets.QSlider.TickPosition.NoTicks) smoothness_slider.valueChanged.connect(self.smoothness_slider_moved) # maximum width smoothness_slider_num = QtWidgets.QLabel("1000.00") metrics = QtGui.QFontMetrics(smoothness_slider_num.font()) - max_width = metrics.width("1000.00") + max_width = metrics.horizontalAdvance("1000.00") smoothness_slider_num.setFixedWidth(max_width) - smoothness_slider_num.setAlignment(Qt.AlignRight) + smoothness_slider_num.setAlignment(Qt.AlignmentFlag.AlignRight) self.smoothness_slider_num = smoothness_slider_num smoothness_slider_layout = QtWidgets.QHBoxLayout()