pyqt

How to download csv file with QWebEngineView and QUrl

廉价感情. 提交于 2021-01-24 09:11:13
问题 I'm building a program which uses QWebEngineView and QUrl to display a website in my PyQt5 app (running on Windows 10). However, I now want to be able to download a CSV file from the same website, but being a noob I can't seem to figure out how. I'm familiar with using requests , urllib.request , urllib3 , etc. for downloading files, but for this, I specifically want to do it with the QWebEngineView, as the user will have authenticated the request previously in the pyqt5 window. The code to

How to convert a .ui file to .py file

北城以北 提交于 2021-01-20 16:10:07
问题 This .ui file is made by Qt Designer. It's just a simple UI. All the commands or codes for doing this on the websites I have looked through are not for windows. 回答1: The pyuic tool works in exactly the same way on all platforms: C:\>pyuic4 -h Usage: pyuic4 [options] <ui-file> Options: --version show program's version number and exit -h, --help show this help message and exit -p, --preview show a preview of the UI instead of generating code -o FILE, --output=FILE write generated code to FILE

How to convert a .ui file to .py file

送分小仙女□ 提交于 2021-01-20 16:09:27
问题 This .ui file is made by Qt Designer. It's just a simple UI. All the commands or codes for doing this on the websites I have looked through are not for windows. 回答1: The pyuic tool works in exactly the same way on all platforms: C:\>pyuic4 -h Usage: pyuic4 [options] <ui-file> Options: --version show program's version number and exit -h, --help show this help message and exit -p, --preview show a preview of the UI instead of generating code -o FILE, --output=FILE write generated code to FILE

How to convert a .ui file to .py file

感情迁移 提交于 2021-01-20 16:09:07
问题 This .ui file is made by Qt Designer. It's just a simple UI. All the commands or codes for doing this on the websites I have looked through are not for windows. 回答1: The pyuic tool works in exactly the same way on all platforms: C:\>pyuic4 -h Usage: pyuic4 [options] <ui-file> Options: --version show program's version number and exit -h, --help show this help message and exit -p, --preview show a preview of the UI instead of generating code -o FILE, --output=FILE write generated code to FILE

Changing the spacing between QTableView cells using stylesheet in PyQt5

喜夏-厌秋 提交于 2021-01-20 11:57:10
问题 How to add spaces between table cells using QSS selectors. I've tried the border-spacing selector, the item pseudo-class with the border selector, but it all doesn't work as it should. Here is a sample code that I thought was supposed to do this. app. setStyleSheet ("QTableView { border-collapse: separate; border-spacing: 10px 20px; color: red;}") Here's a picture of what I mean. 回答1: With style-sheets, you are either able to separate the individual cells via border-spacing (as in your

Make a simple stopwatch stoppable

一笑奈何 提交于 2021-01-20 09:49:44
问题 I'm writing a simple stopwatch with python (using pyqt5). So far, start/pause/resume functions are working fine but the problem is when I stop the counter and need to start from 0 a thread can't be started again I tried the subclass from here but it's not working. import threading from PyQt5 import QtWidgets from stpw_ui import Ui_MainWindow from time import sleep # code snippet from stack overflow to stop a thread class StoppableThread(threading.Thread): def __init__(self, *args, **kwargs):

Make a simple stopwatch stoppable

故事扮演 提交于 2021-01-20 09:48:47
问题 I'm writing a simple stopwatch with python (using pyqt5). So far, start/pause/resume functions are working fine but the problem is when I stop the counter and need to start from 0 a thread can't be started again I tried the subclass from here but it's not working. import threading from PyQt5 import QtWidgets from stpw_ui import Ui_MainWindow from time import sleep # code snippet from stack overflow to stop a thread class StoppableThread(threading.Thread): def __init__(self, *args, **kwargs):

Add QStyles to Pyqt5

前提是你 提交于 2021-01-20 07:07:27
问题 I'm converting my GUI application from PyQt4 to PyQt5. But in PyQt4 we get so many QStyles like plastique , Cleanlooks etc. But in PyQt5 we have only Fusion style along with some plain old Windows styles. How can we add more custom styles to PyQt5? 回答1: Many of Qt's functionalities are implemented by plugins, and that is the case with styles. So in this case you must compile qtstyleplugins: You can use the following procedure to compile qtstyleplugins: Install MSVC 2019 on Windows, XCode on

How to highlight a words in QTableWidget from a Searchlist

青春壹個敷衍的年華 提交于 2021-01-19 06:56:35
问题 I want to search a QTableWidget-Table by a list of words, if they've been found i want them to bee highlighted. I tried to modify the code from here so the table is beeing searched by a list of words, not just one. Unfortunatly my results keep getting overwritten. I always only get the result for the last word in the list. Does anyone know how to modify the code so it will show the result of the whole list of words ? Here is the code: from PyQt5 import QtCore, QtGui, QtWidgets import random

populate combobox editable username and line edit password from sqlite3

∥☆過路亽.° 提交于 2021-01-19 06:35:47
问题 I have 1 combobox editable username and 1 line edit password i want load user list from database sqlite3 to combobox. After load list i want action on itemlist combobox get password current selected user from database. pyqt5 application table columns table records ######Combo Box 2 - PM's self.groupBox_2 = QtWidgets.QGroupBox(self.tab) self.groupBox_2.setGeometry(QtCore.QRect(10, 140, 191, 51)) self.groupBox_2.setObjectName("groupBox_2") self.comboBox_3 = QtWidgets.QComboBox(self.groupBox_2)