diff --git a/spyderlib/utils/introspection/jedi_plugin.py b/spyderlib/utils/introspection/jedi_plugin.py index 808e08ef789..9ba36d46993 100644 --- a/spyderlib/utils/introspection/jedi_plugin.py +++ b/spyderlib/utils/introspection/jedi_plugin.py @@ -27,7 +27,7 @@ jedi = None -JEDI_REQVER = '>=0.8.1' +JEDI_REQVER = '>=0.8.1;<0.9.0' dependencies.add('jedi', _("(Experimental) Editor's code completion," " go-to-definition and help"), diff --git a/spyderlib/widgets/arrayeditor.py b/spyderlib/widgets/arrayeditor.py index 6c111828a40..71c6063196c 100644 --- a/spyderlib/widgets/arrayeditor.py +++ b/spyderlib/widgets/arrayeditor.py @@ -16,7 +16,7 @@ from __future__ import print_function from spyderlib.qt.QtGui import (QHBoxLayout, QColor, QTableView, QItemDelegate, - QLineEdit, QCheckBox, QGridLayout, + QLineEdit, QCheckBox, QGridLayout, QCursor, QDoubleValidator, QDialog, QDialogButtonBox, QMessageBox, QPushButton, QInputDialog, QMenu, QApplication, QKeySequence, QLabel, QComboBox, @@ -381,11 +381,14 @@ def load_more_data(self, value, rows=False, columns=False): self.model().fetch_more(rows=rows) if columns and value == self.horizontalScrollBar().maximum(): self.model().fetch_more(columns=columns) - + def resize_to_contents(self): """Resize cells to contents""" + QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) + self.resizeColumnsToContents() + self.model().fetch_more(columns=True) self.resizeColumnsToContents() - self.resizeRowsToContents() + QApplication.restoreOverrideCursor() def setup_menu(self): """Setup context menu""" diff --git a/spyderlib/widgets/dataframeeditor.py b/spyderlib/widgets/dataframeeditor.py index 47766426913..f27118cb579 100644 --- a/spyderlib/widgets/dataframeeditor.py +++ b/spyderlib/widgets/dataframeeditor.py @@ -16,7 +16,7 @@ from spyderlib.qt.QtCore import QAbstractTableModel, Qt, QModelIndex, Slot from spyderlib.qt.QtGui import (QDialog, QTableView, QColor, QGridLayout, QDialogButtonBox, QHBoxLayout, QPushButton, - QCheckBox, QMessageBox, QInputDialog, + QCheckBox, QMessageBox, QInputDialog, QCursor, QLineEdit, QApplication, QMenu, QKeySequence) from spyderlib.qt.compat import to_qvariant, from_qvariant import spyderlib.utils.icon_manager as ima @@ -511,7 +511,7 @@ def setup_and_check(self, data, title=''): btn.clicked.connect(self.change_format) btn = QPushButton(_('Resize')) btn_layout.addWidget(btn) - btn.clicked.connect(self.dataTable.resizeColumnsToContents) + btn.clicked.connect(self.resize_to_contents) bgcolor = QCheckBox(_('Background color')) bgcolor.setChecked(self.dataModel.bgcolor_enabled) @@ -569,6 +569,13 @@ def get_value(self): else: return df + def resize_to_contents(self): + QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) + self.dataTable.resizeColumnsToContents() + self.dataModel.fetch_more(columns=True) + self.dataTable.resizeColumnsToContents() + QApplication.restoreOverrideCursor() + def test_edit(data, title="", parent=None): """Test subroutine"""