pyqt

PyQt QToolButton not updating icon when in focus

二次信任 提交于 2021-02-02 10:03:55
问题 I'm having a problem updating the icon of a button set with QToolButton . The idea is to use the button for a movie player. To play, one presses the button and the icon changes to pause. When pressed again, play is paused and the icon reverts to play. I have some working code, but the problem is that the icon is not updating consistently. If I keep the Qt window in focus, it takes one or two button presses to change the icon to the intended image, by which time the actual image is not the

PyQt QToolButton not updating icon when in focus

别等时光非礼了梦想. 提交于 2021-02-02 10:03:34
问题 I'm having a problem updating the icon of a button set with QToolButton . The idea is to use the button for a movie player. To play, one presses the button and the icon changes to pause. When pressed again, play is paused and the icon reverts to play. I have some working code, but the problem is that the icon is not updating consistently. If I keep the Qt window in focus, it takes one or two button presses to change the icon to the intended image, by which time the actual image is not the

PyQt QToolButton not updating icon when in focus

孤者浪人 提交于 2021-02-02 10:03:02
问题 I'm having a problem updating the icon of a button set with QToolButton . The idea is to use the button for a movie player. To play, one presses the button and the icon changes to pause. When pressed again, play is paused and the icon reverts to play. I have some working code, but the problem is that the icon is not updating consistently. If I keep the Qt window in focus, it takes one or two button presses to change the icon to the intended image, by which time the actual image is not the

Trying to take a value from a dictionary of a ComboBox and instert the key in a textEdit

。_饼干妹妹 提交于 2021-02-02 09:55:18
问题 I have a dictionary and a ComboBox that shows dictionary's values, i need to print in a textEdit the key of the dictionary's value chosen by the user. Here's my code. import sys from PyQt5.QtCore import pyqtSlot from PyQt5.QtWidgets import QApplication, QDialog, QMainWindow from PyQt5.uic import loadUi from math import pi class MainPage(QMainWindow): classi = {None : None, "C25/30" : float(14.17), "C28/35" : float(15.87), "C32/40" : float(18.13), "C35/45" : float(19.83), "C40/50" : float(22.6

Opening new window while out of focus using “keyboard”

会有一股神秘感。 提交于 2021-02-02 09:28:26
问题 I am trying to track my keypresses, using the module "keyboard" while a PySide2 Widget is not in focus, which works fine. However when I try to create a new Widget using a "keyboard" shortcut the program crashes. Opening a window on a button press works fine. I can also call non UI functions using "keyboard" eg. the print function without any problem. Do you know a way to fix this and open a new window using "keyboard" or any other method, while a PySide2 window is not in focus. In this

How to determine which widget emitted the signal

蹲街弑〆低调 提交于 2021-02-02 09:28:11
问题 I want to make QlineEdit fields double-clickable, so that a user's double-clicking on a QlineEdit field (e.g., 'qle01') calls a function. The function should be able to identify by 'name' the QLineEdit object which sent the signal to the function. I do not know if 'name' is the right word to describe 'qle01' and 'qle02' in my example code below. Maybe a better term would be a 'handle'. In my script below, if qle01 was double-clicked, my goal is to have line 9 print, "The QLineEdit field's

How to show progress bar while saving file to excel in python?

血红的双手。 提交于 2021-02-02 08:35:32
问题 Appreciate if you could help me. I have a trouble showing up the progress bar while saving file to excel. What I want to achieve is to show a progress bar while saving excel file from a pandas dataframe also from qwidgettable as it takes time before it saves. Until the excel file is downloaded or saved i want that progress bar to close. I tried looking over the net but I cant see specific answers to my query. So far, this is the compiled codes I have created. import sys from PyQt5 import

PyQtdeploy-V2.4 User Guide 中文 (二)

耗尽温柔 提交于 2021-02-02 03:44:08
PyQtdeploy 用户指南 <span id = mulu>目录</span> 介绍 与V1.0+的差异 作者 证书 安装 部署过程概览 PyQt的演示 构建演示 Android IOS Linux MacOS Windos 构建系统根目录 标准组建插件 创建Sysroot规范文件 PyQt演示的Sysroot 命令行 编写组建插件 创建PyQtdeploy项目 定义应用程序源 定义qmake配置 添加标准库包 添加其他包 添加其他扩展模块 定义文件和目录位置 构建应用程序 命令行 Windows和动态加载扩展模块 使用pyrcc的应用程序 支持PEP 302可选导入挂钩 pdytools模块 <span id = bsgcgl>部署过程概览</span> PyQtdeploy的母的是将Python应用程序、Python解释器、Python标准库、Python C扩展模块、第三方Python包和第三方扩展模块转换为对于特定目标的单个可执行文件。根据目标,可执行文件可能需要通过某种方式打包才能真正部署。例如:Android应用程序需要签名并打包为 .apk 文件。任何此类打包都不在PyQtdeploy的范围内。 虽然PyQtdeploy允许你创建单个可执行文件,但你能根据需要将组建保留在可执行文件外部。 PyQtdeploy支持一下目标体系结构: Android -32

PyQtdeploy-V2.4 User Guide 中文 (一)

谁都会走 提交于 2021-02-01 07:23:37
PyQtdeploy 用户指南 <span id = mulu>目录</span> 介绍 与V1.0+的差异 作者 证书 安装 部署过程概览 PyQt的演示 构建演示 Android IOS Linux MacOS Windos 构建系统根目录 标准组建插件 创建Sysroot规范文件 PyQt演示的Sysroot 命令行 编写组建插件 创建PyQtdeploy项目 定义应用程序源 定义qmake配置 添加标准库包 添加其他包 添加其他扩展模块 定义文件和目录位置 构建应用程序 命令行 Windows和动态加载扩展模块 使用pyrcc的应用程序 支持PEP 302可选导入挂钩 pdytools模块 <span id = jieshao>介绍</span> PyQtdeploy是一个工具,它通过与Qt提供的其他工具一起支持部署使用Python v2.7或Python v3.3或更高版本编写的PyQt应用程序。它支持部署到桌面平台(Linux,Windows和macOS)和移动平台(iOS和Android)。 通常,您将创建Python解释器库的静态编译版本,包含任何第三方扩展模块、PyQt和Qt。这样您的应用程序就没有外部依赖关系。但是,也可以使用任何这些组件的共享版本来减小应用程序的大小,其代价是增加了部署的复杂性。 pyqtdeploy本身需要PyQt5和Python v3

Run command with PyQt5 and getting the stdout and stderr

随声附和 提交于 2021-01-30 09:07:26
问题 I want to run command with PyQt5. And I want to get the stdout and stderr in time order and in real-time. I separated into UI class and Worker class. There are several UI classes, but for simplicity, I've specified just one. I've tried to solve this problem, but I can't. I can't connect between the Worker thread and logger function. test_ui.py import sys import subprocess from PyQt5.QtWidgets import QApplication, QWidget, QHBoxLayout, QVBoxLayout from PyQt5.QtWidgets import QPushButton,