pyqt5

AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel' for PyQt5 5.15.0

泄露秘密 提交于 2021-01-20 08:10:44
问题 A program I am trying to install requires the installation of PyQt5 5.15.0 , which gives me this error. The odd thing is that the installation works fine for the latest version of PyQt5 (5.15.2), but this program requires 5.15.0 specifically. Command Output: Collecting PyQt5==5.15.0 Using cached PyQt5-5.15.0.tar.gz (3.3 MB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... error ERROR: Command errored out with exit status 1:

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 use QScrollArea to make scrollbars appear

青春壹個敷衍的年華 提交于 2021-01-19 08:02:19
问题 I am trying to create a scroll area with a vertical layout using pyqt5, and I am putting inside some labels. I know that even if it is a vertical layout it is supposed to scroll horizontally if the text does not fit. But no matter what I try it does not let me scroll. This is the code I am using: class window(QMainWindow): def __init__(self): super(window, self).__init__() self.setGeometry(300, 300, 803, 520) self.init_ui() def init_ui(self): self.teacher_box = QScrollArea(self) self.teacher

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)

QLabel correct positioning for text outline

北战南征 提交于 2021-01-16 03:50:16
问题 I am trying to create a label with text outline. I just want a simple white text with black outline. I first tried to do it in css like this label.setStyleSheet("color:white; outline:2px black;") but outline didn’t do anything. I did lots of searching and found the way to do it with qpainter path. But the problem is that the text is always cut off. According to the function the text is supposed to be started from the bottom left but it starts too low and left. I know I can find a point by

QLabel correct positioning for text outline

左心房为你撑大大i 提交于 2021-01-16 03:50:16
问题 I am trying to create a label with text outline. I just want a simple white text with black outline. I first tried to do it in css like this label.setStyleSheet("color:white; outline:2px black;") but outline didn’t do anything. I did lots of searching and found the way to do it with qpainter path. But the problem is that the text is always cut off. According to the function the text is supposed to be started from the bottom left but it starts too low and left. I know I can find a point by

QLabel correct positioning for text outline

…衆ロ難τιáo~ 提交于 2021-01-16 03:48:05
问题 I am trying to create a label with text outline. I just want a simple white text with black outline. I first tried to do it in css like this label.setStyleSheet("color:white; outline:2px black;") but outline didn’t do anything. I did lots of searching and found the way to do it with qpainter path. But the problem is that the text is always cut off. According to the function the text is supposed to be started from the bottom left but it starts too low and left. I know I can find a point by

how to reorder QListView items when the model is QSqlTableModel with drag and drop?

爱⌒轻易说出口 提交于 2021-01-07 02:52:56
问题 i'm working with @eyllanesc answer example and i want to reorder the items i followed many answers in stackoverflow and the qt documentation but i'm not able to make it work, it seems like very hard to reorder items with dragging and droping them. i did it with QListWidget but not with QListView here is my code : import sys from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtSql import * import sys, os def create_connection(): db = QSqlDatabase

Drag window to the edge to resize

隐身守侯 提交于 2021-01-05 11:29:56
问题 I'm working on a plugin for QGIS and i'm using QtCreator. I wanted to implement a function that allows the user to drag the window to the edge of the screen to resize it (such as ordinary windows). My setup being a multiple screen desktop, I came up with this code: from PyQt5 import QtCore, QtGui tracking = False class Window(QtGui.QWidget): def __init__(self): super(Window, self).__init__() self.timer = QtCore.QTimer(self) self.timer.setInterval(50) self.timer.timeout.connect(self.Resize)