python3 fixes

imageview fix
This commit is contained in:
Luke Campagnola 2013-05-13 08:51:59 -04:00
parent 1a0b5921df
commit 09b16baed1
3 changed files with 11 additions and 4 deletions

View File

@ -209,7 +209,7 @@ class ImageView(QtGui.QWidget):
*pos* Change the position of the displayed image
*scale* Change the scale of the displayed image
*transform* Set the transform of the dispalyed image. This option overrides *pos*
*transform* Set the transform of the displayed image. This option overrides *pos*
and *scale*.
============== =======================================================================
"""
@ -271,8 +271,9 @@ class ImageView(QtGui.QWidget):
if levels is None and autoLevels:
self.autoLevels()
if levels is not None: ## this does nothing since getProcessedImage sets these values again.
self.levelMax = levels[1]
self.levelMin = levels[0]
#self.levelMax = levels[1]
#self.levelMin = levels[0]
self.setLevels(*levels)
if self.ui.roiBtn.isChecked():
self.roiChanged()

View File

@ -157,3 +157,9 @@ class ParameterItem(QtGui.QTreeWidgetItem):
## since destroying the menu in mid-action will cause a crash.
QtCore.QTimer.singleShot(0, self.param.remove)
## for python 3 support, we need to redefine hash and eq methods.
def __hash__(self):
return id(self)
def __eq__(self, x):
return x is self

View File

@ -313,7 +313,7 @@ class SpinBox(QtGui.QAbstractSpinBox):
s = [D(-1), D(1)][n >= 0] ## determine sign of step
val = self.val
for i in range(abs(n)):
for i in range(int(abs(n))):
if self.opts['log']:
raise Exception("Log mode no longer supported.")