Skip to content
Advertisement

Tag: pyqt

Display image from SQL DB in QLabel

The database stores images in varbinary format. I am getting data like this b’xffxd8xffxe0x00x10JFIFx00x01x01x01x00x00x00x00xffxe1x00ZExifx… I can save them if I use the code I don’t want to save pictures, i want show them directly in QLabel. How can i do this? Answer I finded solution for my problem.

How to properly submit data when using QDataWidgetMapper?

I’m using a custom model subclassed from QAbstractTableModel, my data is a list of dataclasses. I’ve set up a simple GUI with a QListView and two QLineEdits, like so: I’m trying to achieve that whenever I change the contents of the first QLineEdit, the list-view is updated as well. From reading the documentation for QDataWidgetMapper I know that the model

Drawing a shape over a widget

I need to be able to draw a circle/line on top of another widget, but every time I try, it goes behind. I have read lots of posts about using QPainter over widgets but I still can’t get it to work. The following is a minimal example of my app, and I just want to figure out where to put

How to plot DENDROGRAM in GUI

I am using a GUI from QtDesigner to plot Dendrogram. My code is below, but I can not plot the Dendrogram, how can I fix it? Image of Dendrogram: Answer You have to import the dendrogram from scipy: And then pass it the axes through the ax argument:

How to update PyQt progressbar from an independent function with arguments?

I want to use multiple imported function with arguments that takes some while to run. I want a ‘working’ progress bar that track the processes of that function. I have followed 2 questions already here. Connect an imported function to Qt5 progress bar without dependencies Report progress to QProgressBar using variable from an imported module The difference is that the

How can resources be provided in PyQt6 (which has no pyrcc)?

The documentation for PyQt6 states that Support for Qt’s resource system has been removed (i.e. there is no pyrcc6). In light of this, how should one provide resources for a PyQt6 application? Answer There has been some discussion on the PyQt mailing list when this was found out. The maintainer is not interested in maintaining pyrcc anymore as he believes

PYQT QTimer does not start

I am using PyQt 5 for a GUI app, and I am having a threading issue. There is a close button and once it is clidked, a QTimer starts and then it waits in a while loop that is conditioned on a value of a variable in which is being incremented in the QTimer handler. The problem is that the

Drawing straight line between two points using QPainterPath

I have a scene where I would like to draw a line between two points(mouse press should be the start point and mouse release as the endpoint) using the QPainterpath. Here is a demonstration of how I want it to be. Here is what’s happening with my current code. Below is the code I have tried Answer Every time lineTo

Advertisement