diff --git a/pyqtgraph/Qt.py b/pyqtgraph/Qt.py index 83654c93..23e75570 100644 --- a/pyqtgraph/Qt.py +++ b/pyqtgraph/Qt.py @@ -320,14 +320,6 @@ if QT_LIB in [PYQT5, PYQT6, PYSIDE2, PYSIDE6]: self.setTransform(tr) QtWidgets.QGraphicsItem.translate = translate - def setMargin(self, i): - self.setContentsMargins(i, i, i, i) - QtWidgets.QGridLayout.setMargin = setMargin - - def setResizeMode(self, *args): - self.setSectionResizeMode(*args) - QtWidgets.QHeaderView.setResizeMode = setResizeMode - QtGui.QApplication = QtWidgets.QApplication QtGui.QGraphicsScene = QtWidgets.QGraphicsScene diff --git a/pyqtgraph/flowchart/Flowchart.py b/pyqtgraph/flowchart/Flowchart.py index c904e710..49436e4e 100644 --- a/pyqtgraph/flowchart/Flowchart.py +++ b/pyqtgraph/flowchart/Flowchart.py @@ -616,10 +616,7 @@ class FlowchartCtrlWidget(QtGui.QWidget): self.cwWin.resize(1000,800) h = self.ui.ctrlList.header() - if QT_LIB in ['PyQt4', 'PySide']: - h.setResizeMode(0, h.Stretch) - else: - h.setSectionResizeMode(0, h.Stretch) + h.setSectionResizeMode(0, h.ResizeMode.Stretch) self.ui.ctrlList.itemChanged.connect(self.itemChanged) self.ui.loadBtn.clicked.connect(self.loadClicked) diff --git a/pyqtgraph/parametertree/ParameterTree.py b/pyqtgraph/parametertree/ParameterTree.py index 8c89d37e..203c6513 100644 --- a/pyqtgraph/parametertree/ParameterTree.py +++ b/pyqtgraph/parametertree/ParameterTree.py @@ -1,4 +1,4 @@ -from ..Qt import QtCore, QtGui +from ..Qt import QtCore, QtWidgets from ..widgets.TreeWidget import TreeWidget import os, weakref, re from .ParameterItem import ParameterItem @@ -25,7 +25,7 @@ class ParameterTree(TreeWidget): self.setHeaderLabels(["Parameter", "Value"]) self.setAlternatingRowColors(True) self.paramSet = None - self.header().setResizeMode(QtGui.QHeaderView.ResizeToContents) + self.header().setSectionResizeMode(QtWidgets.QHeaderView.ResizeMode.ResizeToContents) self.setHeaderHidden(not showHeader) self.itemChanged.connect(self.itemChangedEvent) self.itemExpanded.connect(self.itemExpandedEvent)