I can't open Inspector in Ubuntu 15.10 with yadedaily.

Asked by Cong Xu

The Inspector button of yadedaily doesn't work in the Ubuntu 15.10 version. Is there anyone know how to fix it?
Thank you.

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Mark S. Bentley
Solved:
Last query:
Last reply:
Revision history for this message
Anton Gladky (gladky-anton) said :
#1

What do you observe if you try to open it?

Anton

2015-11-11 6:32 GMT+01:00 Cong Xu <email address hidden>:
> The Inspector button of yadedaily doesn't work in the Ubuntu 15.10 version. Is there anyone know how to fix it?

Revision history for this message
Cong Xu (congxu) said :
#2

When I press the Inspect button, the following message appears:

ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line string', (1, 0))

---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/usr/lib/x86_64-linux-gnu/yadedaily/py/yade/__init__.py in inspectSlot(self)
    103 self.displayCombo.addItem(c); afterSep+=1
    104 def inspectSlot(self):
--> 105 self.inspector=SimulationInspector(parent=None)
    106 self.inspector.show()
    107 def setTabActive(self,what):

/usr/lib/x86_64-linux-gnu/yadedaily/py/yade/__init__.py in __init__(self, parent)
    265 self.tabWidget=QTabWidget(self)
    266
--> 267 self.engineInspector=EngineInspector(parent=None)
    268 self.bodyInspector=BodyInspector(parent=None,intrLinkCallback=self.changeIntrIds)
    269 self.intrInspector=InteractionInspector(parent=None,bodyLinkCallback=self.changeBodyId)

/usr/lib/x86_64-linux-gnu/yadedaily/py/yade/__init__.py in __init__(self, parent)
     11 def __init__(self,parent=None):
     12 QWidget.__init__(self,parent)
---> 13 grid=QGridLayout(self); grid.setSpacing(0); grid.setMargin(0)
     14 self.serEd=SeqSerializable(parent=None,getter=lambda:O.engines,setter=lambda x:setattr(O,'engines',x),serType=Engine,path='O.engines')
     15 grid.addWidget(self.serEd)

AttributeError: 'QGridLayout' object has no attribute 'setMargin'

Revision history for this message
Best Mark S. Bentley (msbentley) said :
#3

It looks like setMargin was deprecated and one now uses setContentsMargin (see http://doc.qt.io/qt-5/qlayout.html#setContentsMargins). I got the inspector working by replacing setMargin with setContentsMargins - but instead of a single value, you have to provide the left, top, right, and bottom.

e.g. if you replace

grid.setMargin(0)

with

grid.setContentsMargins(0,0,0,0)

and so on, it seems to work OK (this is with PyQt5 on ubuntu 15.10).

Revision history for this message
Cong Xu (congxu) said :
#4

Thank you Mark.

I use Ubuntu 14.04 instead. It works well in this version.

Revision history for this message
Cong Xu (congxu) said :
#5

Thanks Mark S. Bentley, that solved my question.

Revision history for this message
Kneib François (francois-kneib) said :
#6
Revision history for this message
Jan Stránský (honzik) said :
#8

Hi Jason,

i'm wondering where I can do the modification

in the script, where something.setMargin(...) is used.

cheers
Jan