pyqt

PyQt5: pop-up progressbar using QThread

那年仲夏 提交于 2020-08-20 08:59:05
问题 How can I implement a progress bar in a pop-up window that monitors the progress of a running function from a so-called Worker class (i.e. time/CPU-consuming task) by means of a QThread ? I have checked countless examples and tutorials, but the fact that the progressbar shows up in a pop-up window seems to make everything harder. I believe what I want is a rather simple thing but I keep failing at it and I ran out of ideas. I have an example of what I am trying to achieve, which is based on

Pyqt5 NameError

别来无恙 提交于 2020-08-20 08:04:04
问题 I am trying to find why this gives me a NameError.... Class name App(QDialog): is the one that has the error. I was following exactly as youtube video, while his code works, mine doesn't. Please help me on this. Thanks :) import sys from PyQt5.QtWidgets import QApplication, QWidget, QMainWindow, QPushButton, QMessageBox, QBoxLayout from PyQt5.QtGui import QIcon from PyQt5.QtCore import pyqtSlot from PyQt5.QtWidgets import QTableWidget, QTableWidgetItem from PyQt5.QtWidgets import QInputDialog

python开发环境的搭建和设置

二次信任 提交于 2020-08-19 21:58:45
一、python 开发工具的选择 python开发工具有很多,这里推荐使用 pycharm; 因为jetbrains公司拥有众多的开发工具以及开发拥护者。 这些工具有相同的风格和各类使用案例、描述问题的博客,可供初学者参考。 很多人学习python,不知道从何学起。 很多人学习python,掌握了基本语法过后,不知道在哪里寻找案例上手。 很多已经做案例的人,却不知道如何去学习更加高深的知识。 那么针对这三类人,我给大家提供一个好的学习平台,免费领取视频教程,电子书籍,以及课程的源代码! QQ群:1097524789 1、pycharm professional edition - 专业版,可以试用30天 https://download.jetbrains.8686c.com/python/pycharm-professional-2020.1.1.exe 2、如果你有学校的email,可以申请免费的教育版 https://www.jetbrains.com/zh-cn/education/#lang=python&role=learner 3、免费开源版 https://download.jetbrains.8686c.com/python/pycharm-community-2020.1.1.exe 二、pycharm的兼容性 在选择pycharm的时候,考虑几个兼容性:

PyQt5 之Qwidget控件总结

只愿长相守 提交于 2020-08-19 19:52:49
https://www.cnblogs.com/yang-2018/p/12880313.html 一、常用API 1、大小与位置:   x():相对于父控件的位置,顶层控件(没有父控件)则相对于桌面的x位置   y():相对于父控件的y位置,顶层控件(没有父控件)则相对于桌面的y位置   pos():x和y的组合 QPoint(x, y)   width():控件的宽度,不包含任何窗口框架   height():控件的高度,不包含任何窗口框架   size():width和height的组合 ,QSize(width, height)   geometry():用户区域相对于父控件的位置和尺寸组合 QRect(x, y, width, height)   rect():0, 0, width, height的组合 QRect(0, 0, width, height)   frameSize():框架大小   frameGeometry():框架尺寸   move(x, y):操控的是x, y;也就是pos 包括窗口框架   resize(width, height):操控的是宽高 不包括窗口框架   setGeometry(x_noFrame, y_noFrame, width, height):   adjustSize():根据内容自适应大小   setFixedSize()

PyQt get date from the user

巧了我就是萌 提交于 2020-08-19 14:02:47
问题 I built simple widget in Qt Designer with a button and a QDateEdit. The user will enter the date into the QDateEdit and then when he presses the button, the date will be saved to a variable. How can I do it? 回答1: You can make it simply: var_name = self.dateEdit.date() This will get you a variable in QDate format. If you need it in a format which would be easier to work with then you should use this: temp_var = self.dateEdit.date() var_name = temp_var.toPyDate() The first one gives you: "PyQt4

Which QLabel was pressed by mousePressEvent

寵の児 提交于 2020-08-19 09:08:39
问题 How can I get in method on_product_clicked where QLabel is a mousePressEvent ? In the current example I see three images in the form. When I click the second image I need to have number 2 in the on_product_clicked method. product_images = ['first_icon.png', 'second_icon.png', 'third_icon.png'] self.vbox_choice_img = QHBoxLayout() for image in product_images: label = QLabel() pixmap = QtGui.QPixmap(image) pixmap = pixmap.scaled(250, 250) label.setPixmap(pixmap) label.setAlignment(QtCore.Qt

How to show Folium map inside a PyQt5 GUI?

亡梦爱人 提交于 2020-08-19 08:47:34
问题 I'm trying to show a very simple Folium map inside a Qt GUI. The main code is: import folium m = folium.Map(location=[45.5236, -122.6750]) m m.save('index.html') folium.Map( location=[45.5236, -122.6750], tiles='Stamen Toner', zoom_start=13 ) When I use the code with Jupyter it's fine but shows anything with Spyder. What I want is to show the map in a QGraphicsView or any other QClass on a simple Qt GUI? 回答1: You can save the html in a io.BytesIO() using the save method and then set it to a

How to show Folium map inside a PyQt5 GUI?

本秂侑毒 提交于 2020-08-19 08:42:13
问题 I'm trying to show a very simple Folium map inside a Qt GUI. The main code is: import folium m = folium.Map(location=[45.5236, -122.6750]) m m.save('index.html') folium.Map( location=[45.5236, -122.6750], tiles='Stamen Toner', zoom_start=13 ) When I use the code with Jupyter it's fine but shows anything with Spyder. What I want is to show the map in a QGraphicsView or any other QClass on a simple Qt GUI? 回答1: You can save the html in a io.BytesIO() using the save method and then set it to a

人脸属性标注工具

谁都会走 提交于 2020-08-19 02:58:15
图片查看器: https://github.com/Largefreedom/pyqt5-master/tree/master/img_viewer 人脸特征点标注: https://baijiahao.baidu.com/s?id=1650683721087093374&wfr=spider&for=pc 多属性标注: https://blog.51cto.com/14028810/2306984 二、普通工具 以下几个是通用图片标注工具,属性值自定义 labelImg: https://github.com/tzutalin/labelImg Annotorious: http://annotorious.github.io/index.html RectLabel: https://rectlabel.com/ (适用mac) 人脸数据标注平台/公司 如果你需要标注的数据量很大,预算也比较充足,可以选择数据标注公司来做,省时省力。当然最关心的还是数据安全问题,这个行业鱼龙混杂,建议选择大背景的平台。 京东众智 :标注质量比较高,项目交付准时,数据安全方面签了协议,看过他们的数据隔离方案,比较重视客户的数据安全 百度众测 :标注能力比较广泛,百度做标注也比较久了 figure-eight 国外知名的数据标注平台,国外好多大公司都与它有合作。直接在平台上发任务,没有客户经理沟通.

如何在pyqt中通过调用SetWindowCompositionAttribute实现Win10亚克力效果

女生的网名这么多〃 提交于 2020-08-17 03:53:29
亚克力效果   在我的第一篇博客 《如何在pyqt中实现窗口磨砂效果》 和第二篇博客 《如何在pyqt中实现win10亚克力效果》 中,我都是通过调用编译好的dll来实现窗口效果,这种方法要求电脑上必须装有MSVC。Visual Studio装起来确实费时又占C盘空间,所以今天换了一种实现方法——用纯python的方法实现 SetWindowCompositionAttribute 这个api的调用。我定义了一个WindowEffect类,里面通过调用 SetWindowCompositionAttribute 实现了Aero和亚克力效果,为了方便演示,我在WindowEffect里面还定义了一个用来移动无边框窗口的函数,关于更多无边框窗体的解决方案可以参见我的上一篇博客 《如何在pyqt中在实现无边框窗体的同时保留Windows窗口动画效果》 ,这里面介绍的很详细,不过还是用了一些C++的东西。下面是这次的亚克力效果(老婆太美了(๑¯∀¯๑)): 具体代码   1. 与第二篇博客不同,我在 WindowEffect 的 setAcrylicEffect 函数中新增了两个形参—— isEnableShadow 和 animationId ,看名字就知道一个控制亚克力窗口的阴影,另一个控制磨砂动画。在demo中是看不出 animationId 的具体效果的