python - PyQt5 QMainWindow/QAxWidget线程问题
问题描述
我想在QMainWindow
和之间有不同的线程QAxWidget
。据我所知,QMainWindow
应该有MainThread。所以我写下代码如下。
from PyQt5 import QtCore, QtGui, QtWidgets
import sys
class Main_Thread(QtWidgets.QMainWindow):
def __init__(self):
# setting QMainWindow with widgets... + super().__init__()
sub_instance = Sub_Thread()
sub_thread = QtCore.QThread()
sub_instance.moveToThread(sub_thread)
sub_thread.started.connect(sub_instance.run)
sub_thread.start()
class Sub_Thread(QObject):
def __init__(self):
super().__init__()
def run(self):
ocx = QAxContainer.QAxWidget('connection path')
ocx.signal.connect(slot) # line★
ocx(AcitveX)
有很多信号...
ocx
当我写'line★'时出现没有那种信号的错误
发生了什么样的问题?
ocx
应该在MainThread中进行吗?
解决方案
推荐阅读
- flutter - Flutter中不同的元素位置
- pdf - 将可填写的 pdf 嵌套到新的 pdf 文档中
- r - ggplot 多列(一些列有很多 NaN),在 r 的一个图中带有线和点
- spring-boot - Spring Cloud Config Server 无法使用 SSH 克隆私有 Git 存储库
- java - JsonIgnore 除了一个端点
- json - AWS Spectrum 扫描错误压缩文件意外结束
- objective-c - 背景可在 5.5 和 6.5 英寸 iPhone 设备上完美缩放
- react-native - 使用 useEffect 进行条件渲染和堆栈导航
- python - Scikit 高斯过程预测
- reactjs - 如何使用 React-Select 分阶段控制选择框的 defaultValue?