Fix QString handling
This commit is contained in:
parent
3fd56eb195
commit
08349351da
@ -159,21 +159,21 @@ class RelativityGUI(QtGui.QWidget):
|
|||||||
self.setAnimation(self.params['Animate'])
|
self.setAnimation(self.params['Animate'])
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
filename = str(pg.QtGui.QFileDialog.getSaveFileName(self, "Save State..", "untitled.cfg", "Config Files (*.cfg)"))
|
filename = pg.QtGui.QFileDialog.getSaveFileName(self, "Save State..", "untitled.cfg", "Config Files (*.cfg)")
|
||||||
if isinstance(filename, tuple):
|
if isinstance(filename, tuple):
|
||||||
filename = filename[0] # Qt4/5 API difference
|
filename = filename[0] # Qt4/5 API difference
|
||||||
if filename == '':
|
if filename == '':
|
||||||
return
|
return
|
||||||
state = self.params.saveState()
|
state = self.params.saveState()
|
||||||
pg.configfile.writeConfigFile(state, filename)
|
pg.configfile.writeConfigFile(state, str(filename))
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
filename = str(pg.QtGui.QFileDialog.getOpenFileName(self, "Save State..", "", "Config Files (*.cfg)"))
|
filename = pg.QtGui.QFileDialog.getOpenFileName(self, "Save State..", "", "Config Files (*.cfg)")
|
||||||
if isinstance(filename, tuple):
|
if isinstance(filename, tuple):
|
||||||
filename = filename[0] # Qt4/5 API difference
|
filename = filename[0] # Qt4/5 API difference
|
||||||
if filename == '':
|
if filename == '':
|
||||||
return
|
return
|
||||||
state = pg.configfile.readConfigFile(filename)
|
state = pg.configfile.readConfigFile(str(filename))
|
||||||
self.loadState(state)
|
self.loadState(state)
|
||||||
|
|
||||||
def loadPreset(self, param, preset):
|
def loadPreset(self, param, preset):
|
||||||
|
@ -794,7 +794,7 @@ class ImageView(QtGui.QWidget):
|
|||||||
fileName = fileName[0] # Qt4/5 API difference
|
fileName = fileName[0] # Qt4/5 API difference
|
||||||
if fileName == '':
|
if fileName == '':
|
||||||
return
|
return
|
||||||
self.export(fileName)
|
self.export(str(fileName))
|
||||||
|
|
||||||
def buildMenu(self):
|
def buildMenu(self):
|
||||||
self.menu = QtGui.QMenu()
|
self.menu = QtGui.QMenu()
|
||||||
|
@ -355,7 +355,7 @@ class TableWidget(QtGui.QTableWidget):
|
|||||||
fileName = fileName[0] # Qt4/5 API difference
|
fileName = fileName[0] # Qt4/5 API difference
|
||||||
if fileName == '':
|
if fileName == '':
|
||||||
return
|
return
|
||||||
open(fileName, 'w').write(data)
|
open(str(fileName), 'w').write(data)
|
||||||
|
|
||||||
def contextMenuEvent(self, ev):
|
def contextMenuEvent(self, ev):
|
||||||
self.contextMenu.popup(ev.globalPos())
|
self.contextMenu.popup(ev.globalPos())
|
||||||
|
Loading…
Reference in New Issue
Block a user