MATLAB Answers

0

PyQt4 and Matlab

Asked by Thibaut Jacqmin on 9 Feb 2017
Latest activity Commented on by Thibaut Jacqmin on 3 Oct 2017
PyQt4 can be imported however every time an item is created it closes the Matlab session...
qtgui = py.importlib.import_module('PyQt4.QtGui');
layout = qtgui.QVBoxLayout();
% The following lines close Matlab
button = qtgui.QPushButton('My text');
layout.addWidget(button);

  3 Comments

What is your OS: Mac, Linux, or Windows?
Thibaut Jacqmin on 1 Oct 2017
My OS is Windows. Sorry to answer so late, I did not see your answer...
Thibaut Jacqmin on 3 Oct 2017
Actually it does not work on Matlab 2017b (Windows 10) either, with python 3 and PyQt5. The follwing code leads to a Matlab shutdown :
qtgui = py.importlib.import_module('PyQt5.QtWidgets');
layout = qtgui.QVBoxLayout();
% The following lines close Matlab
button = qtgui.QPushButton('My text');
layout.addWidget(button);

Sign in to comment.

0 Answers