Skip to content

Commit 09902f9

Browse files
committed
Follow PyQt6 API changes in diverging-mode editor
1 parent 7e19769 commit 09902f9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

viscm/gui.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,7 @@ def __init__(self, figurecanvas, viscm_editor, parent=None):
11851185
mainlayout.addLayout(min_slider_layout)
11861186

11871187
if viscm_editor.cmtype == "diverging":
1188-
smoothness_slider = QtWidgets.QSlider(Qt.Horizontal)
1188+
smoothness_slider = QtWidgets.QSlider(Qt.Orientation.Horizontal)
11891189
# We want the slider to vary filter_k exponentially between 5 and
11901190
# 1000. So it should go from [log10(5), log10(1000)]
11911191
# which is about [0.699, 3.0]
@@ -1194,15 +1194,15 @@ def __init__(self, figurecanvas, viscm_editor, parent=None):
11941194
# to deal with this.
11951195
smoothness_slider.setMinimum(699)
11961196
smoothness_slider.setMaximum(3000)
1197-
smoothness_slider.setTickPosition(QtWidgets.QSlider.NoTicks)
1197+
smoothness_slider.setTickPosition(QtWidgets.QSlider.TickPosition.NoTicks)
11981198
smoothness_slider.valueChanged.connect(self.smoothness_slider_moved)
11991199

12001200
# maximum width
12011201
smoothness_slider_num = QtWidgets.QLabel("1000.00")
12021202
metrics = QtGui.QFontMetrics(smoothness_slider_num.font())
1203-
max_width = metrics.width("1000.00")
1203+
max_width = metrics.horizontalAdvance("1000.00")
12041204
smoothness_slider_num.setFixedWidth(max_width)
1205-
smoothness_slider_num.setAlignment(Qt.AlignRight)
1205+
smoothness_slider_num.setAlignment(Qt.AlignmentFlag.AlignRight)
12061206
self.smoothness_slider_num = smoothness_slider_num
12071207

12081208
smoothness_slider_layout = QtWidgets.QHBoxLayout()

0 commit comments

Comments
 (0)