← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3719: Fix crash in Qt5.

 

------------------------------------------------------------
revno: 3719
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Fri 2015-08-28 21:31:57 +0200
message:
  Fix crash in Qt5.
modified:
  gui/qt5/SerializableEditor.py
  py/remote.py


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'gui/qt5/SerializableEditor.py'
--- gui/qt5/SerializableEditor.py	2015-08-28 19:31:57 +0000
+++ gui/qt5/SerializableEditor.py	2015-08-28 19:31:57 +0000
@@ -2,6 +2,7 @@
 from PyQt5.QtCore import *
 from PyQt5.QtGui import *
 from PyQt5 import QtGui
+from PyQt5 import QtWidgets
 from PyQt5.QtWidgets import *
 
 import re,itertools
@@ -85,7 +86,7 @@
 		AttrEditor.__init__(self,getter,setter)
 		QFrame.__init__(self,parent)
 		self.checkBox=QCheckBox(self)
-		lay=QVBoxLayout(self); lay.setSpacing(0); lay.setMargin(0); lay.addStretch(1); lay.addWidget(self.checkBox); lay.addStretch(1)
+		lay=QVBoxLayout(self); lay.setSpacing(0); lay.addStretch(1); lay.addWidget(self.checkBox); lay.addStretch(1)
 		self.checkBox.clicked.connect(self.update)
 	def refresh(self): self.checkBox.setChecked(self.getter())
 	def update(self): self.trySetter(self.checkBox.isChecked())
@@ -203,7 +204,7 @@
 	def __init__(self,parent,getter,setter):
 		AttrEditor.__init__(self,getter,setter)
 		QFrame.__init__(self,parent)
-		self.grid=QGridLayout(self); self.grid.setSpacing(0); self.grid.setMargin(0)
+		self.grid=QGridLayout(self); self.grid.setSpacing(0);
 		for row,col in itertools.product(range(2),range(5)): # one additional column for vertical line in quaternion
 			if (row,col)==(0,3): continue
 			if (row,col)==(0,4): self.grid.addWidget(QLabel(u'←<i>pos</i> ↙<i>ori</i>',self),row,col); continue
@@ -249,7 +250,7 @@
 		self.setContentsMargins(0,0,0,0)
 		self.first=True
 		val=self.getter()
-		self.grid=QGridLayout(self); self.grid.setSpacing(0); self.grid.setMargin(0)
+		self.grid=QGridLayout(self); self.grid.setSpacing(0);
 		for row,col in itertools.product(range(self.rows),range(self.cols)):
 			w=QLineEdit('')
 			self.grid.addWidget(w,row,col);
@@ -364,7 +365,7 @@
 			self.lineNo,self.widget=None,None
 	def __init__(self,ser,parent=None,ignoredAttrs=set(),showType=False,path=None):
 		"Construct window, *ser* is the object we want to show."
-		QtGui.QFrame.__init__(self,parent)
+		QtWidgets.QFrame.__init__(self,parent)
 		self.ser=ser
 		self.path=(ser.label if (hasattr(ser,'label') and ser.label) else path)
 		self.showType=showType

=== modified file 'py/remote.py'
--- py/remote.py	2015-08-27 09:47:13 +0000
+++ py/remote.py	2015-08-28 19:31:57 +0000
@@ -117,7 +117,6 @@
 
 def _runInBackground(func):
 	if useQThread:
-		from PyQt5.QtCore import QThread
 		class WorkerThread(QThread):
 			def __init__(self,func_): QThread.__init__(self); self.func=func_
 			def run(self): self.func()