本文整理汇总了Python中PyQt5.QtWidgets.QApplication.setOverrideCursor方法的典型用法代码示例。如果您正苦于以下问题:Python QApplication.setOverrideCursor方法的具体用法?Python QApplication.setOverrideCursor怎么用?Python QApplication.setOverrideCursor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QApplication
的用法示例。
在下文中一共展示了QApplication.setOverrideCursor方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_accepted
# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import setOverrideCursor [as 别名]
def on_accepted(self):
QApplication.setOverrideCursor(Qt.WaitCursor)
iq_data, sample_rate = self.parse_csv_file(self.filename, self.ui.comboBoxCSVSeparator.currentText(),
self.ui.spinBoxIDataColumn.value()-1,
self.ui.spinBoxQDataColumn.value()-1,
self.ui.spinBoxTimestampColumn.value()-1)
target_filename = self.filename.rstrip(".csv")
if os.path.exists(target_filename + ".complex"):
i = 1
while os.path.exists(target_filename + "_" + str(i) + ".complex"):
i += 1
else:
i = None
target_filename = target_filename if not i else target_filename + "_" + str(i)
target_filename += ".complex"
iq_data.tofile(target_filename)
self.data_imported.emit(target_filename, sample_rate if sample_rate is not None else 0)
QApplication.restoreOverrideCursor()
示例2: on_export_fta_wanted
# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import setOverrideCursor [as 别名]
def on_export_fta_wanted(self):
try:
initial_name = self.signal.name + "-spectrogram.ft"
except Exception as e:
logger.exception(e)
initial_name = "spectrogram.ft"
filename = FileOperator.get_save_file_name(initial_name, caption="Export spectrogram")
if not filename:
return
QApplication.setOverrideCursor(Qt.WaitCursor)
try:
self.ui.gvSpectrogram.scene_manager.spectrogram.export_to_fta(sample_rate=self.signal.sample_rate,
filename=filename,
include_amplitude=filename.endswith(".fta"))
except Exception as e:
Errors.exception(e)
finally:
QApplication.restoreOverrideCursor()
示例3: read_opened_filenames
# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import setOverrideCursor [as 别名]
def read_opened_filenames(self):
if self.project_file is not None:
tree = ET.parse(self.project_file)
root = tree.getroot()
file_names = []
for file_tag in root.findall("open_file"):
pos = int(file_tag.attrib["position"])
filename = file_tag.attrib["name"]
if not os.path.isfile(filename):
filename = os.path.normpath(os.path.join(self.project_path, filename))
file_names.insert(pos, filename)
QApplication.setOverrideCursor(Qt.WaitCursor)
file_names = FileOperator.uncompress_archives(file_names, QDir.tempPath())
QApplication.restoreOverrideCursor()
return file_names
return []
示例4: main
# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import setOverrideCursor [as 别名]
def main(self):
while 1:
to_new_word = False
try:
word, globalX = config.queue_to_translate.get(False)
except:
time.sleep(config.update_time)
continue
# changing cursor to hourglass during translation
QApplication.setOverrideCursor(Qt.WaitCursor)
threads = []
for translation_function_name in config.translation_function_names:
threads.append(threading.Thread(target = globals()[translation_function_name], args = (word,)))
for x in threads:
x.start()
while any(thread.is_alive() for thread in threads):
if config.queue_to_translate.qsize():
to_new_word = True
break
time.sleep(config.update_time)
QApplication.restoreOverrideCursor()
if to_new_word:
continue
if config.block_popup:
continue
self.get_translations.emit(word, globalX, False)
# drawing layer
# because can't calculate outline with precision
示例5: add_uri_audio_media_cue
# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import setOverrideCursor [as 别名]
def add_uri_audio_media_cue():
"""Add audio MediaCue(s) form user-selected files"""
if get_backend() is None:
QMessageBox.critical(MainWindow(), 'Error', 'Backend not loaded')
return
# Default path to system "music" folder
path = QStandardPaths.writableLocation(QStandardPaths.MusicLocation)
# Get the backend extensions and create a filter for the Qt file-dialog
extensions = get_backend().supported_extensions()
filters = qfile_filters(extensions, anyfile=False)
# Display a file-dialog for the user to choose the media-files
files, _ = QFileDialog.getOpenFileNames(MainWindow(),
translate('MediaCueMenus',
'Select media files'),
path, filters)
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
# Create media cues, and add them to the Application cue_model
for file in files:
cue = CueFactory.create_cue('URIAudioCue', uri='file://' + file)
# Use the filename without extension as cue name
cue.name = os.path.splitext(os.path.basename(file))[0]
Application().cue_model.add(cue)
QApplication.restoreOverrideCursor()
示例6: override_cursor
# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import setOverrideCursor [as 别名]
def override_cursor(self, cursor):
self._cursor = cursor
if self.current_cursor() is None:
QApplication.setOverrideCursor(cursor)
else:
QApplication.changeOverrideCursor(cursor)
示例7: returnCursorToNormal
# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import setOverrideCursor [as 别名]
def returnCursorToNormal(self) -> None:
cursor: QCursor = QCursor(Qt.ArrowCursor)
QApplication.setOverrideCursor(cursor)
QApplication.changeOverrideCursor(cursor)
示例8: mouseMoveEvent
# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import setOverrideCursor [as 别名]
def mouseMoveEvent(self, event: QMouseEvent) -> None:
pattern = re.compile(FOLDING_PATTERN)
block: QTextBlock = self.editor.getBlockUnderCursor(event)
if pattern.match(block.text()):
cursor: QCursor = QCursor(Qt.PointingHandCursor)
QApplication.setOverrideCursor(cursor)
QApplication.changeOverrideCursor(cursor)
else:
self.returnCursorToNormal()
示例9: on_bandpass_filter_triggered
# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import setOverrideCursor [as 别名]
def on_bandpass_filter_triggered(self, f_low: float, f_high: float):
self.filter_abort_wanted = False
QApplication.instance().setOverrideCursor(Qt.WaitCursor)
filter_bw = Filter.read_configured_filter_bw()
filtered = Array("f", 2 * self.signal.num_samples)
p = Process(target=perform_filter,
args=(filtered, self.signal.iq_array.as_complex64(), f_low, f_high, filter_bw))
p.daemon = True
p.start()
while p.is_alive():
QApplication.instance().processEvents()
if self.filter_abort_wanted:
p.terminate()
p.join()
QApplication.instance().restoreOverrideCursor()
return
time.sleep(0.1)
filtered = np.frombuffer(filtered.get_obj(), dtype=np.complex64)
signal = self.signal.create_new(new_data=filtered.astype(np.complex64))
signal.name = self.signal.name + " filtered with f_low={0:.4n} f_high={1:.4n} bw={2:.4n}".format(f_low, f_high,
filter_bw)
self.signal_created.emit(signal)
QApplication.instance().restoreOverrideCursor()