Merge pull request #1662 from NilsNemitz/cast-to-int_in_ImageView_QSplitter.setSizes

added cast to int so that QSplitter.setSizes works on Python 3.10
This commit is contained in:
Ogi Moore 2021-03-26 12:39:38 -07:00 committed by GitHub
commit 1a597b80b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -113,7 +113,7 @@ class Canvas(QtGui.QWidget):
if not self.sizeApplied:
self.sizeApplied = True
s = min(self.width(), max(100, min(200, self.width()*0.25)))
s = int( min(self.width(), max(100, min(200, self.width()//4))) )
s2 = self.width()-s
self.ui.splitter.setSizes([s2, s])

View File

@ -563,7 +563,7 @@ class ImageView(QtGui.QWidget):
self.roi.show()
#self.ui.roiPlot.show()
self.ui.roiPlot.setMouseEnabled(True, True)
self.ui.splitter.setSizes([self.height()*0.6, self.height()*0.4])
self.ui.splitter.setSizes([int(self.height()*0.6), int(self.height()*0.4)])
self.ui.splitter.handle(1).setEnabled(True)
self.roiCurve.show()
self.roiChanged()