Questions tagged [qlabel]

The QLabel widget, part of the Qt framework, provides a text or image display.

No user interaction functionality is provided. The visual appearance of the label can be configured in various ways, and it can be used for specifying a focus mnemonic key for another widget.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

653 questions
2
votes
1 answer

PyQt: How to prevent processing multiple resize events when maximizing a window?

I have a QMainWindow containing a child QWidget containing itself a QLabel. When the window is maximized (e.g. by clicking the maximize icon on the window), the QLabel.resizeEvent() handler is called multiple times (supposedly to follow the…
mins
  • 6,478
  • 12
  • 56
  • 75
2
votes
1 answer

Image Viewer GUI fails to properly map coordinates for mouse press event

I am trying to piece together PyQt5 based image viewer Python code from various sources and extend capability to crop regions of interest (ROI) within loaded images. The issue is that the mapped coordinates and mouse clicks consider scroll bar and…
Far
  • 121
  • 1
  • 11
2
votes
1 answer

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…
Roman
  • 35
  • 5
2
votes
1 answer

-1073740791 (0xC0000409) Error when setting Pixmap on QLabel

As sadly as Python/PyQt does not give give specific error messages about things like these, I am only getting this error code when running my code. Process finished with exit code -1073740791 (0xC0000409) I am using PyQt and OpenCV to build an app…
Daene Bancud
  • 21
  • 1
  • 3
2
votes
1 answer

PyQt5 label cut off

When I run this program, parts of my label gets cut off. Is there any way to fix this? I'm guessing it has to do with setFont, because when I remove l1.setFont all the text shows. If possible, please list solutions that doesn't alter the GUI too…
2
votes
1 answer

Change QLabel color using python code not html?

I have searched for how to change QLabel text however I could not find anything which was not in html. Their was a few things claiming to do this but I could not get it to work really hoping for somthing I can copy and past then work out how it…
Carl
  • 61
  • 10
2
votes
1 answer

Open and save image file using menubar in PyQt5

I've written the following code to open image file using a menubar in PyQt5. It is able to select the file but not able to display it in the window. I've successfully opened text file but not able to do the same for images. Can you please rectify my…
2
votes
1 answer

Open a .pdf by clicking on QLabel made as Hyperlink

I have been trying to create something which lets me click on Qlabel (converted to hyperlink) and opens a .pdf file. I got the two following ideas from PYQT QLabel link to open folder on computer: Idea 1 self.text_label.setText('
Shaurya Garg
  • 105
  • 3
  • 11
2
votes
1 answer

QLabel not resizing after changing its text

I have a QLabel centered in a custom QGraphicsPolygonItem and I'm using a QAction to change the labels text, but when the text changes the label size doesn't change, I want it to resize to the size of the new text and keep it centered. Here's my…
Matheus Ianzer
  • 425
  • 8
  • 22
2
votes
2 answers

Qlabel in front of a QGridLayout

I am trying to make a QLabel appear over a QGridLayout, but I cannot figure how to do it. This is a sample code: from PyQt5.QtWidgets import QWidget, QApplication, QGridLayout, QFrame, QLabel import sys class Foo(QWidget): def…
Víctor Martínez
  • 854
  • 2
  • 11
  • 29
2
votes
2 answers

PyQt5: Update labels inrun time

I have a problem updating labels in a loop during run time. I think I need to use signals and so on, but I've tried everything I can think of now. What I want my program to do: When I click the button a loop should start that run some function that…
2
votes
1 answer

How to set text in a QLabel and display '<>' characters?

Using PySide2 (basically PyQt5), I'm trying to setText in a QLabel that has the characters '<' and '>' in the string. But, since these characters are used to modify the font, anything within those two characters disappears. I tried escaping them…
silent_sight
  • 492
  • 1
  • 8
  • 16
2
votes
0 answers

Python 3.6 | PyQt5 | QLabel doesn't display QPixmap

I'm trying to display a PNG image in a Widget using QLabel. I built the Widget using Qt Designer and the label shows the image properly. When I load the .ui into mi .py and execute it, everything shows up well, except for the label. I tried loading…
Felipe Q.
  • 33
  • 1
  • 5
2
votes
2 answers

copy QPixmap of one Qlabel to another Qlabel

I am trying to add a QPixmap to a QLabel taken from another QLabel but there is an error : Here is the code const QPixmap *tempPix = new QPixmap(""); tempPix = (label1->pixmap()); label2->setPixmap(tempPix); //error cannot convert from const…
Ammar H Sufyan
  • 97
  • 1
  • 3
  • 13
2
votes
1 answer

Modify alpha channel transparency of a windowless QLabel

I have a very small Qt application that uses labels to display a jpeg image without first putting it in a window. (I got a lot of help from Display QImage with QtGui) Now I would like to change the alpha channel of this jpeg to make the image…
Josh Kurland
  • 197
  • 1
  • 3
  • 12