python direct_Python Qt.DirectConnection方法代码示例
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import DirectConnection [as 别名]
def initThumbs(self) -> None:
framesize = self.parent.videoService.framesize()
thumbsize = QSize(
VideoService.config.thumbnails['TIMELINE'].height() * (framesize.width() / framesize.height()),
VideoService.config.thumbnails['TIMELINE'].height())
positions, frametimes = [], []
thumbs = int(math.ceil((self.rect().width() - (self.offset * 2)) / thumbsize.width()))
for pos in range(thumbs):
val = QStyle.sliderValueFromPosition(self.minimum(), self.maximum(),
(thumbsize.width() * pos) - self.offset,
self.rect().width() - (self.offset * 2))
positions.append(val)
positions[0] = 1000
[frametimes.append(self.parent.delta2QTime(msec).toString(self.parent.timeformat)) for msec in positions]
class ThumbWorker(QObject):
completed = pyqtSignal(list)
def __init__(self, settings: QSettings, media: str, times: list, size: QSize):
super(ThumbWorker, self).__init__()
self.settings = settings
self.media = media
self.times = times
self.size = size
@pyqtSlot()
def generate(self):
frames = list()
[
frames.append(VideoService.captureFrame(self.settings, self.media, frame, self.size))
for frame in self.times
]
self.completed.emit(frames)
self.thumbsThread = QThread(self)
self.thumbsWorker = ThumbWorker(self.parent.settings, self.parent.currentMedia, frametimes, thumbsize)
self.thumbsWorker.moveToThread(self.thumbsThread)
self.thumbsThread.started.connect(self.parent.sliderWidget.setLoader)
self.thumbsThread.started.connect(self.thumbsWorker.generate)
self.thumbsThread.finished.connect(self.thumbsThread.deleteLater, Qt.DirectConnection)
self.thumbsWorker.completed.connect(self.buildTimeline)
self.thumbsWorker.completed.connect(self.thumbsWorker.deleteLater, Qt.DirectConnection)
self.thumbsWorker.completed.connect(self.thumbsThread.quit, Qt.DirectConnection)
self.thumbsThread.start()
python direct_Python Qt.DirectConnection方法代码示例相关推荐
- python dateformatter_Python dates.DateFormatter方法代码示例
本文整理汇总了Python中matplotlib.dates.DateFormatter方法的典型用法代码示例.如果您正苦于以下问题:Python dates.DateFormatter方法的具体用法 ...
- python paperclip_Python pyplot.sca方法代码示例
本文整理汇总了Python中matplotlib.pyplot.sca方法的典型用法代码示例.如果您正苦于以下问题:Python pyplot.sca方法的具体用法?Python pyplot.sca ...
- python fonttool_Python wx.Font方法代码示例
本文整理汇总了Python中wx.Font方法的典型用法代码示例.如果您正苦于以下问题:Python wx.Font方法的具体用法?Python wx.Font怎么用?Python wx.Font使用 ...
- python res_Python models.resnet152方法代码示例
本文整理汇总了Python中torchvision.models.resnet152方法的典型用法代码示例.如果您正苦于以下问题:Python models.resnet152方法的具体用法?Pyth ...
- python dropout_Python slim.dropout方法代码示例
本文整理汇总了Python中tensorflow.contrib.slim.dropout方法的典型用法代码示例.如果您正苦于以下问题:Python slim.dropout方法的具体用法?Pytho ...
- python batch_size_Python config.batch_size方法代码示例
本文整理汇总了Python中config.batch_size方法的典型用法代码示例.如果您正苦于以下问题:Python config.batch_size方法的具体用法?Python config. ...
- python pool_Python pool.Pool方法代码示例
本文整理汇总了Python中multiprocessing.pool.Pool方法的典型用法代码示例.如果您正苦于以下问题:Python pool.Pool方法的具体用法?Python pool.Po ...
- python nextpow2_Python signal.hann方法代码示例
本文整理汇总了Python中scipy.signal.hann方法的典型用法代码示例.如果您正苦于以下问题:Python signal.hann方法的具体用法?Python signal.hann怎么 ...
- python colormap_Python colors.LinearSegmentedColormap方法代码示例
本文整理汇总了Python中matplotlib.colors.LinearSegmentedColormap方法的典型用法代码示例.如果您正苦于以下问题:Python colors.LinearSe ...
最新文章
- export_symbol的使用
- 简述人工智能的发展历程图_简述墙体彩绘机发展历程
- 【C++基础】 类模板
- 前端学习(360):svn操作前期连接工作
- import com.google.common.* 出错,找不到
- iis+php解析漏洞修复,服务器解析漏洞分析和漏洞修复方法
- Datastructure
- [转载] c++的vector赋值方法汇总
- ai跟随路径_AI机器人掌勺 马桥豆腐干飘香,长三角文博会上的这些“马桥元素”大放异彩...
- 基于Android的手机邮件收发(JavaMail)之四(邮件的发送)
- Java中的求和公式_Sympy codegen:求和索引函数
- 让生如夏花之绚烂 死如秋叶之静美 (全诗)
- 各种快递查询--Api接口
- 《袁老师访谈录》第一期|吴恩柏教授/香港科大协理副校长:【成功,说到底要非常专注!】...
- ubuntu下搜狗输入法ctrl+alt+b会调出虚拟键盘,热键冲突
- 3Dmax+Substance Painter(SP)+.glb+threejs 次时代效果
- java入门学习教程,详细说明
- 网络实时流量监测工具iftop
- 浅谈仪表的两线制、三线制、四线制
- 走亲访友不慌!手把手教你怎样用Mask R-CNN和Python做一个抢车位神器
热门文章
- 在ASP.net中的UpdatePanel,弹窗失败解决办法
- JasperReport学习笔记6-JRXML的标签
- mstsc.exe的小插件,隐藏客户端计算机名
- 入行老师-郭靖(亦师亦友)同学
- 原来歌这样唱也很好听
- HTMLTESTRunner自动化测试报告增加截图功能
- python-opencv实现简单的车牌定位
- linux下配置mysql默认编码utf8
- web.xml 模板和Servlet版本
- light_oj 1236 求最小公倍数( lcm(a,b) )等于n的数对 素因数分解