Skip to content
Advertisement

Tag: pyqt5

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

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,

Display an image in a label without saving it

The following lines are in my script: from PyQt5 import QtGui, QtWidgets, QtCore from PyQt5.QtGui import QIcon, QPixmap from PyQt5.Widgets import * import cv2 def positioningCross(Dy, Dx, center, imgCross): if(center[1,0]>=center[0,0]): Dy2 = center[0,0] + np.absolute(Dy) else: Dy2 = center[1,0] + np.absolute(Dy) if(center[0,1]>=center[1,1]): Dx2 = center[1,1] + np.absolute(Dx)/2 else: Dx2 = center[0,1] + np.absolute(Dx)/2 P1 = (center[0,1]/2,center[0,0]/2) P2 = (center[1,1]/2,center[1,0]/2) P3

Qt Framework, PyQt5 and AttributeError: ‘MyApp’ object has no attribute ‘myAttribute’

Last week I started to learn Python and I developed some command line apps. Now I would like to develop apps with GUI. I searched in internet and I found a project that fits my needs: Qt Project (http://qt-project.org) and PyQt (http://www.riverbankcomputing.com/software/pyqt/intro). I installed Qt 5.3.2 Open Source, SIP 4.16.4, PyQt5 5.3.2 on Mac OS X 10.10 and python 2.7.6.

How can I change the cursor shape with PyQt?

I have a simple application that runs a process that can last for several minutes before completing. I am trying to provide an indication to the user that it is processing the request – such as changing the cursor to an hourglass. But I cannot quite get it to work right. All of my attempts have resulted in either an

Advertisement