I have a QPainterPath and I want to crop an image which is QPixmap. This code worked for me but I want to use PyQt5 builtin functionality like mask without numpy Answer One possible way to replace mask is to use the setClipPath() method of QPainter:
Tag: pyqt
The Foundry Nuke – Display an animated value on a QLabel
I am currently trying to display a value in a QLabel (QLineEdit would work too) based on a NUKE (or Maya) timeline. I am using Nuke to run the code and I would like to display the value based on the current frame to display something like this: The current frame is 1001. If I change to frame 1002, I
Post request by QWebEngineHttpRequest (PyQt5)
I have a question about making POST request in PyQt5. Unfortunately official documentation for this framework for Python doesen’t exist. I have to translate docs from C++ to Python. I have a problem with handle it. To make POST request I have to create instance of class QWebEngineHttpRequest (docs), and then add POST data by setPostData(), it looks to be
Inserting rows in QTreeView that uses QSortFilterProxyModel
I have a very basic app that displays a tree view and a button that adds items to that tree view, using current selection as a parent. Inserting a first level child works well while inserting the 3d level child fails for some reason (it just is not displayed after inserting is done. I’ve prepared fully verifiable code that you
Adding items to QlistView
I’m using pyqt4 with python 2.7 and I have a list view widget that I can’t add items to it As you guys can see i used But it gave me an error that is talking about arguments and data types: Also, is it right to use ListView here or I should use listwidget? In general, what is the difference
clicked.connect() will not access the method
I have a seperate script that calls this one… I don’t understand why my button click is not going into the corresponding function. I am quite new at this so if you do know the answer, could you explain it to me so that I can learn it. Answer Remove this line: self.windowWid = QWidget() and change layout = QGridLayout(self.windowWid)
PyQt5 QImage from Numpy Array
Considering the following code I get the following error TypeError: arguments did not match any overloaded call: QImage(): too many arguments QImage(QSize, QImage.Format): argument 1 has unexpected type ‘numpy.ndarray’ QImage(int, int, QImage.Format): argument 1 has unexpected type ‘numpy.ndarray’ QImage(bytes, int, int, QImage.Format): argument 1 has unexpected type ‘numpy.ndarray’ QImage(sip.voidptr, int, int, QImage.Format): argument 1 has unexpected type ‘numpy.ndarray’ QImage(bytes, int,
How to add a QVideoWidget in Qt Designer?
I want to insert video in blue box(ui image) but I don’t know how to insert video file. My code is here. I don’t know how to add video… Just know example that make video player … Thank you for reading my question. Answer Qt Designer does not show all the Qt widget, and often we want to add our
Why does PyQt crashes without information? (exit code 0xC0000409)
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: I have crashes when I read/write serialEnabled in run() or in ConnDisconn(). I know that PyQt is not thread-safe and that a wrong handling of variables
PyQt Label not changing text
I have this code running on a PyQt window on windows: Inside the “runSimulation” code I start a subprocess using the method “call”. This blocks my GUI and at the title of the window appears “Python stopping responding”, but if I wait a little bit the subprocess finishes normally, and the label is finally changed. But what I want is