pyqt

PyDev doesn't recognise PyQt5

旧巷老猫 提交于 2021-01-27 16:08:33
问题 I am following a tutorial on pyqt, and got this code: import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * class Example(QWidget): def __init__(self): super(Example, self).__init__() self.initUI() def initUI(self): cb = QCheckBox('Show title', self) cb.move(20, 20) cb.toggle() cb.stateChanged.connect(self.changeTitle) self.setGeometry(300, 300, 250, 150) self.setWindowTitle('Checkbox') self.show() def changeTitle(self, state): if state == Qt.Checked:

How to scroll QListWidget to selected item

北城余情 提交于 2021-01-27 13:07:53
问题 The code below creates a single dialog window with QListWidget and QPushButton . Clicking the button fires up a scroll() function which finds and selects an "ITEM-0011". I wonder if there is a way to scroll the list widget so the selected ITEM-0011 is at the top edge of QListWidget ? Here is how the end result should look like: from PyQt4 import QtCore, QtGui app=QtGui.QApplication([]) def scroll(): item = listWidget.findItems('ITEM-0011', QtCore.Qt.MatchRegExp)[0] item.setSelected(True)

How to get the current QApplication in pyQt?

落花浮王杯 提交于 2021-01-27 06:44:08
问题 I am trying to get a reference to the current QApplication object with pyQt5, but couldn't find the function. My search about "pyQt get current QApplication" shows results about how to create an QApplication. So my question is: Is there a global QApplication object, and if so how can get a reference to an existing (the current) application. The reason I ask, is that I want to test if a debugging code is running within a Qt GUI application. Then, I'd like to bring up a QMessagebox to show

How to get the current QApplication in pyQt?

独自空忆成欢 提交于 2021-01-27 06:42:27
问题 I am trying to get a reference to the current QApplication object with pyQt5, but couldn't find the function. My search about "pyQt get current QApplication" shows results about how to create an QApplication. So my question is: Is there a global QApplication object, and if so how can get a reference to an existing (the current) application. The reason I ask, is that I want to test if a debugging code is running within a Qt GUI application. Then, I'd like to bring up a QMessagebox to show

How to get the current QApplication in pyQt?

不羁的心 提交于 2021-01-27 06:41:17
问题 I am trying to get a reference to the current QApplication object with pyQt5, but couldn't find the function. My search about "pyQt get current QApplication" shows results about how to create an QApplication. So my question is: Is there a global QApplication object, and if so how can get a reference to an existing (the current) application. The reason I ask, is that I want to test if a debugging code is running within a Qt GUI application. Then, I'd like to bring up a QMessagebox to show

Embedding python 3.4 into C++ Qt Application?

杀马特。学长 韩版系。学妹 提交于 2021-01-27 04:37:10
问题 I'm making an Qt Quick GUI application(for windows), which uses OpenGL and C++ for some computationally intensive stuff. I want to embed python code into the app, for doing some stuff which is comparatively easier in python. Basically, I just want the c++ code to call a function in a python script and let the script do the job, then store the returned data in a variable(string, or float etc.) for further use. I'm using Qt creator, and I got python3 lib for MinGW compiler. I tried some code,

Can a PyQt4 QObject be queried to determine if the underlying C++ instance has been destroyed?

早过忘川 提交于 2021-01-27 04:21:49
问题 The destroyed() signal can be trapped for a QObject, but I would like to simply test if the Python object still references a valid C++ Qt object. Is there a method for doing so directly? 回答1: If you import the sip module you can call its .isdeleted function. import sip from PyQt4.QtCore import QObject q = QObject() sip.isdeleted(q) False sip.delete(q) q <PyQt4.QtCore.QObject object at 0x017CCA98> q.isdeleted(q) Traceback (most recent call last): File "<stdin>", line 1, in <module>

Is there any solution regarding to PyQt library doesn't work in Mac OS Big Sur?

删除回忆录丶 提交于 2021-01-26 04:02:01
问题 I've done some project using PyQt library for my class assignmnet. And I need to check my application working before I submit it. Today, 3 hours ago I updated my Mac book OS to Big Sur. And I found out that PyQt library doesn't work. It doesn't show any GUI. Are there someone know how to fix it? 回答1: Adding os.environ['QT_MAC_WANTS_LAYER'] = '1' fixes the issue on PyQT 5.15.1 (credits) 回答2: Rolling back to PyQt5==5.13.0 fixed the issue for me! you should uninstall PyQt5 and then install it

Is there any solution regarding to PyQt library doesn't work in Mac OS Big Sur?

☆樱花仙子☆ 提交于 2021-01-26 03:58:33
问题 I've done some project using PyQt library for my class assignmnet. And I need to check my application working before I submit it. Today, 3 hours ago I updated my Mac book OS to Big Sur. And I found out that PyQt library doesn't work. It doesn't show any GUI. Are there someone know how to fix it? 回答1: Adding os.environ['QT_MAC_WANTS_LAYER'] = '1' fixes the issue on PyQT 5.15.1 (credits) 回答2: Rolling back to PyQt5==5.13.0 fixed the issue for me! you should uninstall PyQt5 and then install it

究极全面炼丹教程,使用PaddleOCR并自己训练模型,太上老君看了都说好

筅森魡賤 提交于 2021-01-25 11:05:29
使用PaddleOCR,训练自己的模型 前言______PaddleOcr的安装与准备工作 资料准备 1. 下载icdar2015图片集 2. 下载icdar2015数据集配套的标注文件 3.组织数据集路径 4.下载预训练模型 5.组织预训练模型路径 6.修改配置文件 ~~设置完成,开始训练~~ 到了紧张刺激的DEBUG环节才对 如何制作自己的数据集? 模型评估与模型检查 ps:为方便读者文章中需要用到的文件均使用我的网盘分享下载,同时也会给出官网下载地址 前言______PaddleOcr的安装与准备工作 1.PaddleOcr相关组件安装我在上一个博客中已经介绍完毕→ PaddleOcr安装与使用全程指南 ←点击跳转 2.下载PaddleOcr官方文件包, https://kyc592.lanzous.com/i5C7Gkojm7c 密码:kyc 或官网下载地址:https://gitee.com/paddlepaddle/PaddleOCR 然后解压到项目文件夹的根目录下。 一定确保按照前一篇博客操作完毕,Paddleocr可以正常运行,尽量减少待会出现的极 其 繁 重的debug工作。 至此完成准备工作。 资料准备 训练自己的模型,需要的资料有: ①训练用的图片集 ②测试用的图片集 ③前面两个图片集配套的标注文件 ④预训练模型 1. 下载icdar2015图片集 演示采用的