本文整理汇总了Python中PyQt5.QtCore.Qt.WaitCursor方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.WaitCursor方法的具体用法?Python Qt.WaitCursor怎么用?Python Qt.WaitCursor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.WaitCursor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WaitCursor [as 别名]
def __init__(self, inMsg=' Loading...', inMaxStep=1):
"""
"""
# Save reference to the QGIS interface
# initialize progressBar
# QApplication.processEvents() # Help to keep UI alive
self.iface = iface
widget = iface.messageBar().createMessage('Please wait ', inMsg)
prgBar = QProgressBar()
self.prgBar = prgBar
widget.layout().addWidget(self.prgBar)
iface.messageBar().pushWidget(widget)
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
# if Max 0 and value 0, no progressBar, only cursor loading
# default is set to 0
prgBar.setValue(1)
# set Maximum for progressBar
prgBar.setMaximum(inMaxStep)
示例2: handle_signal_loaded
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WaitCursor [as 别名]
def handle_signal_loaded(self, protocol):
self.setCursor(Qt.WaitCursor)
self.ui.cbShowDataBitsOnly.setEnabled(True)
self.ui.chkBoxLockSIV.setEnabled(True)
self.ui.btnAutoDetect.setEnabled(True)
self.protocol = protocol
# Apply bit length of original signal to current modulator
self.ui.spinBoxSamplesPerSymbol.setValue(self.ui.gVOriginalSignal.signal.samples_per_symbol)
# https://github.com/jopohl/urh/issues/130
self.ui.gVModulated.show_full_scene(reinitialize=True)
self.ui.gVCarrier.show_full_scene(reinitialize=True)
self.ui.gVData.show_full_scene(reinitialize=True)
self.unsetCursor()
示例3: export_demodulated
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WaitCursor [as 别名]
def export_demodulated(self):
try:
initial_name = self.signal.name + "-demodulated.complex"
except Exception as e:
logger.exception(e)
initial_name = "demodulated.complex"
filename = FileOperator.get_save_file_name(initial_name)
if filename:
try:
self.setCursor(Qt.WaitCursor)
data = self.signal.qad
if filename.endswith(".wav"):
data = self.signal.qad.astype(np.float32)
data /= np.max(np.abs(data))
FileOperator.save_data(IQArray(data, skip_conversion=True), filename, self.signal.sample_rate,
num_channels=1)
self.unsetCursor()
except Exception as e:
QMessageBox.critical(self, self.tr("Error exporting demodulated data"), e.args[0])
示例4: draw_spectrogram
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WaitCursor [as 别名]
def draw_spectrogram(self, show_full_scene=False, force_redraw=False):
self.setCursor(Qt.WaitCursor)
window_size = 2 ** self.ui.sliderFFTWindowSize.value()
data_min, data_max = self.ui.sliderSpectrogramMin.value(), self.ui.sliderSpectrogramMax.value()
redraw_needed = self.ui.gvSpectrogram.scene_manager.set_parameters(self.signal.iq_array.data,
window_size=window_size,
data_min=data_min, data_max=data_max)
self.ui.gvSpectrogram.scene_manager.update_scene_rect()
if show_full_scene:
self.ui.gvSpectrogram.show_full_scene()
if redraw_needed or force_redraw:
self.ui.gvSpectrogram.scene_manager.show_full_scene()
self.ui.gvSpectrogram.show_full_scene()
self.on_slider_y_scale_value_changed()
self.__set_samples_in_view()
self.unsetCursor()
示例5: on_cb_signal_view_index_changed
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WaitCursor [as 别名]
def on_cb_signal_view_index_changed(self):
self.setCursor(Qt.WaitCursor)
self.__set_spectrogram_adjust_widgets_visibility()
if self.ui.cbSignalView.currentText().lower() == "spectrogram":
self.ui.stackedWidget.setCurrentWidget(self.ui.pageSpectrogram)
self.draw_spectrogram(show_full_scene=True)
self.__set_selected_bandwidth()
self.ui.labelRSSI.hide()
else:
self.ui.stackedWidget.setCurrentWidget(self.ui.pageSignal)
self.ui.gvSignal.scene_type = self.ui.cbSignalView.currentIndex()
self.scene_manager.mod_type = self.signal.modulation_type
self.ui.gvSignal.redraw_view(reinitialize=True)
self.ui.labelRSSI.show()
self.ui.gvSignal.auto_fit_view()
self.ui.gvSignal.refresh_selection_area()
qApp.processEvents()
self.on_slider_y_scale_value_changed() # apply YScale to new view
self.__set_samples_in_view()
self.__set_duration()
self.unsetCursor()
示例6: contextMenuEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WaitCursor [as 别名]
def contextMenuEvent(self, event: QContextMenuEvent):
if self.signal is None:
return
menu = QMenu()
apply_to_all_action = menu.addAction(self.tr("Apply values (BitLen, 0/1-Threshold, Tolerance) to all signals"))
menu.addSeparator()
auto_detect_action = menu.addAction(self.tr("Auto-Detect signal parameters"))
action = menu.exec_(self.mapToGlobal(event.pos()))
if action == apply_to_all_action:
self.setCursor(Qt.WaitCursor)
self.apply_to_all_clicked.emit(self.signal)
self.unsetCursor()
elif action == auto_detect_action:
self.setCursor(Qt.WaitCursor)
self.signal.auto_detect(detect_modulation=False, detect_noise=False)
self.unsetCursor()
示例7: on_export_fta_wanted
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WaitCursor [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()
示例8: show_open_dialog
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WaitCursor [as 别名]
def show_open_dialog(self, directory=False):
dialog = FileOperator.get_open_dialog(directory_mode=directory, parent=self, name_filter="full")
if dialog.exec_():
try:
file_names = dialog.selectedFiles()
folders = [folder for folder in file_names if os.path.isdir(folder)]
if len(folders) > 0:
folder = folders[0]
for f in self.signal_tab_controller.signal_frames:
self.close_signal_frame(f)
self.project_manager.set_project_folder(folder)
else:
self.setCursor(Qt.WaitCursor)
file_names = FileOperator.uncompress_archives(file_names, QDir.tempPath())
self.add_files(file_names)
self.unsetCursor()
except Exception as e:
Errors.exception(e)
self.unsetCursor()
示例9: read_opened_filenames
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WaitCursor [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 []
示例10: main
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WaitCursor [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
示例11: add_uri_audio_media_cue
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WaitCursor [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()
示例12: showKeyframes
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WaitCursor [as 别名]
def showKeyframes(self):
qApp.setOverrideCursor(Qt.WaitCursor)
keyframes = self.parent.videoService.getKeyframes(self.media, formatted_time=True)
kframes = KeyframesDialog(keyframes, self)
kframes.show()
示例13: setWaitCursor
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WaitCursor [as 别名]
def setWaitCursor(self):
self.setCursor(Qt.WaitCursor)
示例14: save_as
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WaitCursor [as 别名]
def save_as(self, filename: str):
QApplication.instance().setOverrideCursor(Qt.WaitCursor)
self.filename = filename
FileOperator.save_signal(self)
self.name = os.path.splitext(os.path.basename(filename))[0]
self.changed = False
QApplication.instance().restoreOverrideCursor()
示例15: on_btn_fuzzing_clicked
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WaitCursor [as 别名]
def on_btn_fuzzing_clicked(self):
fuz_mode = "Successive"
if self.ui.rbConcurrent.isChecked():
fuz_mode = "Concurrent"
elif self.ui.rBExhaustive.isChecked():
fuz_mode = "Exhaustive"
self.setCursor(Qt.WaitCursor)
fuzz_action = Fuzz(self.table_model.protocol, fuz_mode)
self.table_model.undo_stack.push(fuzz_action)
for row in fuzz_action.added_message_indices:
self.table_model.update_checksums_for_row(row)
self.unsetCursor()
self.ui.tableMessages.setFocus()