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

Auto adjust size of QLabel according to text it contains

I have a QLabel and I would like to adjust the size of it, according to the text it contains (plus some margin on the sides)., I've tried this: self.WarnLab = QtGui.QLabel(self.HeaderRight) font =…
BitFreak
  • 406
  • 3
  • 10
2
votes
1 answer

PyQt5 Paint Circle Over Video in QLabel

I want to draw a circle that displays over a video at the cursor location when pressing the mouse. The video is playing in a QLabel object that is in a MainWindow. I’m using OpenCV to read frames from the webcam at 10 fps. I’m converting the…
slalomchip
  • 779
  • 2
  • 9
  • 25
2
votes
2 answers

How to draw with QPainter on top of already placed QLabel or QPixmap?

While experimenting with Python and PyQt5 I got stuck on a problem. I have in my GUI few labels (QLabel) and images (QPixmap) and I want to draw something on them, depending on what the main program does. I can't figure out how though. For example,…
cyanidem
  • 103
  • 2
  • 9
2
votes
1 answer

remove unnecessary blank space in Qlabel

I want labels on the left to all have the same horizontal length while text aligned to the left. Their vertical size equals vertical size of the respective right widget. Labels on the right to take as little space as possible. Basically remove…
Vitamin C
  • 135
  • 11
2
votes
1 answer

PyQt loading images from URL to QPixmap causes freezes and crash

I made an app that collects URLs of images from a website and displays them on display one by one. However, when you scroll through images with QComboBox, the program freezes for 2-3 seconds which is annoying, considering there are more than 100…
Mirrah
  • 125
  • 2
  • 9
2
votes
0 answers

QRenderCapture saves strange screenshots

Our company is in need to capture the rendering of a Qt3d scene. For this I created a small example application, that illustrates the usage of our capturing. On the left-hand side you will find the 3D scene and on the right-hand side there is a…
Aleph0
  • 5,816
  • 4
  • 29
  • 80
2
votes
3 answers

Change QLabel text dynamically not working

I am trying to change the QLabel text dymanically using QtDesigner, pyqt5. Below is the code i am trying to use for changing the QLabel text dymanically. from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import * from PyQt5.QtCore…
2
votes
1 answer

Qt Drag and Drop works in window. Can i make it so i can only drop into a Qlabel and not the entire window?

Using Qt to create an application that accepts a file drop. I have an area on my UI that I want to drop the file into, using a Qlabel. I have the function of dragging and dropping the file into the UI working, however I can drop it anywhere on the…
ConnorDWP
  • 21
  • 3
2
votes
1 answer

How to add QLabels into QTableWidget with different alignment

I have QTableWidget in which chat messages (normal QLabels) should be added. I have only one column in this table, while the alignment depends on the sender (me=left, him=right) I know that I can add a widget into QTableWidget…
Mohammed B.
  • 160
  • 1
  • 3
  • 13
2
votes
1 answer

Putting images and text in QLabel

I have a list of paragraphs like this: list1 = [ "something", "more", ... "{ //image// }" "something" ... "{ //image// }" ... ] The "{ //image// }" text occurs a known amount in the list. I have another list with paths to images…
SdahlSean
  • 573
  • 3
  • 13
2
votes
1 answer

Changing QLabel on a push of a button each time its pressed it's overwrited

I want to print out the average of a set of 3 numbers the user inputs. However ever time I push the button the text overlaps eachother def Comp Average = QtGui.QLabel("The Students Average is " + str(self.average), self) …
Ayman Almuti
  • 51
  • 1
  • 8
2
votes
4 answers

QLabel change font color without changing any other style

I want to change the color of the text in a QLabel dynamically. I have defined the color and style of the QLabel in the ui file and I want to change it when a certain event takes place. I want to change the color without changing any other style of…
fa__
  • 267
  • 5
  • 17
2
votes
2 answers

Qt4: QLabel -> QPixmap -> click to open URL

I have a QLabel without any text but with a QPixmap image. I can not figure out a way to open a url when the user clicks the image. I can not use text in QLabel here.
yolo
  • 2,757
  • 6
  • 36
  • 65
2
votes
1 answer

How to make text in a label go onto the next line after it is a certain length

I'm working a little GUI in PyQt5/Python 3 for a project at school, but I'm having trouble with the text being cut off. Using label.adjustSize() doesn't fix it, and I can't think of any other way to get around it. I want to have it so that the label…
2
votes
1 answer

QLabel show images like a video

I try to let a QLabel show images like a video. I want this display my images from f0000.png to f0039.png slowly so I can see progress. For some reason my for loop starts with 50. When I see the program run it only show one image or it change too…
5407
  • 39
  • 9