pyqt

好工具推荐系列:Python IDE之Spyder和Jupyter

☆樱花仙子☆ 提交于 2020-08-06 19:54:22
IDE流行度 KDnuggets2018年的一个博客发起了一项投票:数据科学中最好用的Python IDE是什么?本次调查共有1900多人参与,调查结果如下图所示。前5个选择是: Jupyter,57% PyCharm,35% Spyder,27% Visual Studio Code,21% Sublime Text,12% IDE用途 如果是web开发或大工程,建议使用PyCharm; 如果是数据处理,建议Spyder;Spyder是使用PyQt开发的GUI。 而Jupyter Notebook 已迅速成为数据分析,机器学习的必备工具。因为它可以让数据分析师集中精力向用户解释整个分析过程。 Jupyter这个名字是它要服务的三种语言的缩写:Julia,Python和R,这个名字与“木星(jupiter)”谐音。 IDE官网 1.Spyder https://www.spyder-ide.org/ https://github.com/spyder-ide/spyder https://pypi.org/project/spyder/ 2.Jupyter https://github.com/jupyter/notebook https://github.com/jupyter/jupyter 3.Pycharm https://www.jetbrains.com/pycharm

Why does PyQt crashes without information? (exit code 0xC0000409)

牧云@^-^@ 提交于 2020-08-04 09:11:10
问题 I'm trying to develop a software with PyQt, but I often get stuck on software crashes without debug information (only the exit code 0xC0000409). I'm using QThread, and I wrote a system like this: class serialThreadC(QThread): updateOutBox = QtCore.pyqtSignal(str) updateStatus = QtCore.pyqtSignal(int) def __init__(self): super(serialThreadC, self).__init__() self.ser = False self.state = 0 self.serialEnabled = False def run(self): while True: if self.state == -3 or self.state == -2: if self

QStyledItemDelegate to display QComboBox in QTableView

萝らか妹 提交于 2020-08-03 04:12:36
问题 I'm new to Python and PyQt5. I'm using QStyledItemDelegate to make one of the QTableView column consisting of only ComboBox. I managed to display the ComboBox but and I'm having trouble with its behavior. Problem 1: The ComboBox doesn't seems to commit changes to the model even though selection was changed. I used the export button to print out the list for checking purposes. Problem 2: When I add a new row to the table, the new row ComboBox selection keeps reverting back to the first

QStyledItemDelegate to display QComboBox in QTableView

独自空忆成欢 提交于 2020-08-03 04:12:27
问题 I'm new to Python and PyQt5. I'm using QStyledItemDelegate to make one of the QTableView column consisting of only ComboBox. I managed to display the ComboBox but and I'm having trouble with its behavior. Problem 1: The ComboBox doesn't seems to commit changes to the model even though selection was changed. I used the export button to print out the list for checking purposes. Problem 2: When I add a new row to the table, the new row ComboBox selection keeps reverting back to the first

Capture webcam video using PyQt

久未见 提交于 2020-08-03 03:32:29
问题 Given the following PyQt code, I can perfectly capture the webcam's streaming video. Now, I want to modify code, so a button named ''capture'' button is added that once pressed captures the streaming video and saves the image . How can I do this? The obtained small image will be used to query an object recognition server. import sys from PyQt4 import QtGui, QtCore import cv2 class QtCapture(QtGui.QWidget): def __init__(self, *args): super(QtGui.QWidget, self).__init__() self.fps = 24 self.cap

Increase Height of QPushButton in PyQT

a 夏天 提交于 2020-08-02 08:16:34
问题 I have 2 QPushButton in the app window: btn1 needs to be 5x the height of btn2 . Problem: Tried setting the row span of self.btn1 to 5 using layout.addWidget but the height remains unchanged. did I miss out on a setting? import sys from PyQt4 import QtGui, QtCore class MainWindow(QtGui.QMainWindow): def __init__(self): super(MainWindow, self).__init__() self.initUI() def initUI(self): layout = QtGui.QGridLayout() self.btn1 = QtGui.QPushButton('Hello') self.btn2 = QtGui.QPushButton('World')

How to replace a Widget with another using Qt?

北城余情 提交于 2020-07-31 08:46:10
问题 I have an QHBoxLayout with a QTreeWidget on the left, a separator on the middle and a widget on the right. When I click on the QTreeWidget , I want to change the widget on the right to modify the QTreeWidgetItem I tried to do this with this code : def new_rendez_vous(self): self.ui.horizontalLayout_4.removeWidget(self.ui.editionFormWidget) del self.ui.editionFormWidget self.ui.editionFormWidget = RendezVousManagerDialog(self.parent) self.ui.editionFormWidget.show() self.ui.horizontalLayout_4

How to replace a Widget with another using Qt?

爱⌒轻易说出口 提交于 2020-07-31 08:43:44
问题 I have an QHBoxLayout with a QTreeWidget on the left, a separator on the middle and a widget on the right. When I click on the QTreeWidget , I want to change the widget on the right to modify the QTreeWidgetItem I tried to do this with this code : def new_rendez_vous(self): self.ui.horizontalLayout_4.removeWidget(self.ui.editionFormWidget) del self.ui.editionFormWidget self.ui.editionFormWidget = RendezVousManagerDialog(self.parent) self.ui.editionFormWidget.show() self.ui.horizontalLayout_4

Struggling to create qrc in Notepad++

[亡魂溺海] 提交于 2020-07-31 06:00:17
问题 I would like to show an image in a QLabel widget, the image folder is called Health info, the image is called image.png but I'm struggling to create the qrc resource file in Notepad++. <RCC> <qresource prefix="/images"> <file>C:\Users\Vlork\Desktop\Health info/image.png</file> <qresource> </RCC> 来源: https://stackoverflow.com/questions/62955738/struggling-to-create-qrc-in-notepad

Different hover styling on different labels

回眸只為那壹抹淺笑 提交于 2020-07-31 05:50:13
问题 self.scrollArea.setStyleSheet("background-color: rgba(255, 0, 0, 0); border-style:none;\n" "}\n" "QLabel#label2 { \n" " background-color: rgba(0, 0, 0, 120); color: white; text: center; border-style:solid; border- width: 1px; border-top-style: none;\n" "}\n" "QLabel#label3 { \n" "background-color: rgba(0, 0, 0, 0); color: rgba(255, 255, 255, 0); text: center;\n" "}\n" "QLabel:hover + QLabel#label2{ \n" "background-color: rgb(0, 0, 0, 120); color: rgba(255,255,255,255); text: center;\n" "}\n"