本文整理汇总了Python中spyderlib.qt.QtGui.QApplication.restoreOverrideCursor方法的典型用法代码示例。如果您正苦于以下问题:Python QApplication.restoreOverrideCursor方法的具体用法?Python QApplication.restoreOverrideCursor怎么用?Python QApplication.restoreOverrideCursor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类spyderlib.qt.QtGui.QApplication
的用法示例。
在下文中一共展示了QApplication.restoreOverrideCursor方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: resize_to_contents
# 需要导入模块: from spyderlib.qt.QtGui import QApplication [as 别名]
# 或者: from spyderlib.qt.QtGui.QApplication import restoreOverrideCursor [as 别名]
def resize_to_contents(self):
"""Resize cells to contents"""
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
self.resizeColumnsToContents()
self.model().fetch_more(columns=True)
self.resizeColumnsToContents()
QApplication.restoreOverrideCursor()
示例2: save_data
# 需要导入模块: from spyderlib.qt.QtGui import QApplication [as 别名]
# 或者: from spyderlib.qt.QtGui.QApplication import restoreOverrideCursor [as 别名]
def save_data(self, filename=None):
"""Save data"""
if filename is None:
filename = self.filename
if filename is None:
filename = getcwd()
filename, _selfilter = getsavefilename(self, _("Save data"),
filename,
iofunctions.save_filters)
if filename:
self.filename = filename
else:
return False
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
QApplication.processEvents()
if self.is_internal_shell:
wsfilter = self.get_internal_shell_filter('picklable',
check_all=True)
namespace = wsfilter(self.shellwidget.interpreter.namespace).copy()
error_message = iofunctions.save(namespace, filename)
else:
settings = self.get_view_settings()
error_message = monitor_save_globals(self._get_sock(),
settings, filename)
QApplication.restoreOverrideCursor()
QApplication.processEvents()
if error_message is not None:
QMessageBox.critical(self, _("Save data"),
_("<b>Unable to save current workspace</b>"
"<br><br>Error message:<br>%s") % error_message)
self.save_button.setEnabled(self.filename is not None)
示例3: ending_long_process
# 需要导入模块: from spyderlib.qt.QtGui import QApplication [as 别名]
# 或者: from spyderlib.qt.QtGui.QApplication import restoreOverrideCursor [as 别名]
def ending_long_process(self, message=""):
"""
Clearing main window's status bar
and restoring mouse cursor
"""
QApplication.restoreOverrideCursor()
self.show_message(message, timeout=2000)
QApplication.processEvents()
示例4: mouseMoveEvent
# 需要导入模块: from spyderlib.qt.QtGui import QApplication [as 别名]
# 或者: from spyderlib.qt.QtGui.QApplication import restoreOverrideCursor [as 别名]
def mouseMoveEvent(self, event):
"""Show Pointing Hand Cursor on error messages"""
text = self.get_line_at(event.pos())
if get_error_match(text):
if not self.__cursor_changed:
QApplication.setOverrideCursor(QCursor(Qt.PointingHandCursor))
self.__cursor_changed = True
event.accept()
return
if self.__cursor_changed:
QApplication.restoreOverrideCursor()
self.__cursor_changed = False
self.QT_CLASS.mouseMoveEvent(self, event)
示例5: import_data
# 需要导入模块: from spyderlib.qt.QtGui import QApplication [as 别名]
# 或者: from spyderlib.qt.QtGui.QApplication import restoreOverrideCursor [as 别名]
def import_data(self, filenames=None):
"""Import data from text file"""
title = _("Import data")
if filenames is None:
if self.filename is None:
basedir = getcwd()
else:
basedir = osp.dirname(self.filename)
filenames, _selfilter = getopenfilenames(self, title, basedir,
iofunctions.load_filters)
if not filenames:
return
elif is_text_string(filenames):
filenames = [filenames]
for filename in filenames:
self.filename = to_text_string(filename)
ext = osp.splitext(self.filename)[1].lower()
if ext not in iofunctions.load_funcs:
buttons = QMessageBox.Yes | QMessageBox.Cancel
answer = QMessageBox.question(self, title,
_("<b>Unsupported file extension '%s'</b><br><br>"
"Would you like to import it anyway "
"(by selecting a known file format)?"
) % ext, buttons)
if answer == QMessageBox.Cancel:
return
formats = list(iofunctions.load_extensions.keys())
item, ok = QInputDialog.getItem(self, title,
_('Open file as:'),
formats, 0, False)
if ok:
ext = iofunctions.load_extensions[to_text_string(item)]
else:
return
load_func = iofunctions.load_funcs[ext]
# 'import_wizard' (self.setup_io)
if is_text_string(load_func):
# Import data with import wizard
error_message = None
try:
text, _encoding = encoding.read(self.filename)
if self.is_internal_shell:
self.editor.import_from_string(text)
else:
base_name = osp.basename(self.filename)
editor = ImportWizard(self, text, title=base_name,
varname=fix_reference_name(base_name))
if editor.exec_():
var_name, clip_data = editor.get_data()
monitor_set_global(self._get_sock(),
var_name, clip_data)
except Exception as error:
error_message = str(error)
else:
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
QApplication.processEvents()
if self.is_internal_shell:
namespace, error_message = load_func(self.filename)
interpreter = self.shellwidget.interpreter
for key in list(namespace.keys()):
new_key = fix_reference_name(key,
blacklist=list(interpreter.namespace.keys()))
if new_key != key:
namespace[new_key] = namespace.pop(key)
if error_message is None:
interpreter.namespace.update(namespace)
else:
error_message = monitor_load_globals(self._get_sock(),
self.filename, ext)
QApplication.restoreOverrideCursor()
QApplication.processEvents()
if error_message is not None:
QMessageBox.critical(self, title,
_("<b>Unable to load '%s'</b>"
"<br><br>Error message:<br>%s"
) % (self.filename, error_message))
self.refresh_table()
示例6: resize_to_contents
# 需要导入模块: from spyderlib.qt.QtGui import QApplication [as 别名]
# 或者: from spyderlib.qt.QtGui.QApplication import restoreOverrideCursor [as 别名]
def resize_to_contents(self):
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
self.dataTable.resizeColumnsToContents()
self.dataModel.fetch_more(columns=True)
self.dataTable.resizeColumnsToContents()
QApplication.restoreOverrideCursor()
示例7: leaveEvent
# 需要导入模块: from spyderlib.qt.QtGui import QApplication [as 别名]
# 或者: from spyderlib.qt.QtGui.QApplication import restoreOverrideCursor [as 别名]
def leaveEvent(self, event):
"""If cursor has not been restored yet, do it now"""
if self.__cursor_changed:
QApplication.restoreOverrideCursor()
self.__cursor_changed = False
self.QT_CLASS.leaveEvent(self, event)
示例8: tab_released
# 需要导入模块: from spyderlib.qt.QtGui import QApplication [as 别名]
# 或者: from spyderlib.qt.QtGui.QApplication import restoreOverrideCursor [as 别名]
def tab_released(self, event):
"""Method called when a tab from a QTabBar has been released."""
QApplication.restoreOverrideCursor()
self.moving = False
示例9: initialize_continued
# 需要导入模块: from spyderlib.qt.QtGui import QApplication [as 别名]
# 或者: from spyderlib.qt.QtGui.QApplication import restoreOverrideCursor [as 别名]
def initialize_continued(self):
"""Load home page"""
self.go_home()
QApplication.restoreOverrideCursor()
示例10: leaveEvent
# 需要导入模块: from spyderlib.qt.QtGui import QApplication [as 别名]
# 或者: from spyderlib.qt.QtGui.QApplication import restoreOverrideCursor [as 别名]
def leaveEvent(self, event):
"""If cursor has not been restored yet, do it now"""
if self.__cursor_changed:
QApplication.restoreOverrideCursor()
self.__cursor_changed = False
ConsoleBaseWidget.leaveEvent(self, event)
示例11: rehighlight
# 需要导入模块: from spyderlib.qt.QtGui import QApplication [as 别名]
# 或者: from spyderlib.qt.QtGui.QApplication import restoreOverrideCursor [as 别名]
def rehighlight(self):
self.outlineexplorer_data = {}
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
QSyntaxHighlighter.rehighlight(self)
QApplication.restoreOverrideCursor()