当前位置: 首页>>代码示例>>Python>>正文


Python QApplication.setOverrideCursor方法代码示例

本文整理汇总了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() 
开发者ID:jopohl,项目名称:urh,代码行数:25,代码来源:CSVImportDialog.py

示例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() 
开发者ID:jopohl,项目名称:urh,代码行数:21,代码来源:SignalFrame.py

示例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 [] 
开发者ID:jopohl,项目名称:urh,代码行数:20,代码来源:ProjectManager.py

示例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 
开发者ID:oltodosel,项目名称:interSubs,代码行数:38,代码来源:interSubs.py

示例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() 
开发者ID:FrancescoCeruti,项目名称:linux-show-player,代码行数:31,代码来源:media_cue_menus.py

示例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) 
开发者ID:thomaskuestner,项目名称:CNNArt,代码行数:8,代码来源:canvas.py

示例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) 
开发者ID:CountryTk,项目名称:Hydra,代码行数:7,代码来源:foldArea.py

示例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() 
开发者ID:CountryTk,项目名称:Hydra,代码行数:16,代码来源:foldArea.py

示例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() 
开发者ID:jopohl,项目名称:urh,代码行数:30,代码来源:SignalFrame.py


注:本文中的PyQt5.QtWidgets.QApplication.setOverrideCursor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。