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
1
vote
1 answer

Get (X,Y) position of the Text in QLabel

How to get the starting position of text in the QLabel. Ex: How can i get the Left Top position of the text displayed in the QLabel(only) without overriding the paintEvent. I dont have permission to override paintEvent or use other widgets like…
Wagmare
  • 1,354
  • 1
  • 24
  • 58
1
vote
1 answer

in Qt Creator, How to set background image on QLabel of specific Class

I created a new class clickable label which inherits from QLabel and acts as a sort of "push button". I would like to use background images as the button it self. This way I could also change the background image for various states (disabled,…
Jim
  • 9
  • 3
1
vote
1 answer

QLabels with setWordWrap(True) are not resizing vertically when placed in a QListWidget, even though resizeMode has been set to Adjust

How can i put QLabels with setWordWrap(True) inside of a QListWidget/QListView so that the QLabels are resized correctly when the parent widget is resized? When i have tried to do this i have ran into problems with the QLabels not getting the right…
sunyata
  • 1,843
  • 5
  • 27
  • 41
1
vote
2 answers

Rounding a QLabel's corners in PyQt5

I have a QLabel displaying a rectangular image. The corners of the image should be cut to be circular. I use PyQt5 and have no idea on how to do it. I tried to set a painter and draw a roundedrect, but it shows on top of my image. I could use some…
b_dani
  • 19
  • 1
  • 5
1
vote
1 answer

PyQt5 Qlabel QPixmap Rotation using pushButton

So i am trying to rotate QLabel with a button but i am getting error and not sure what is going on: Process finished with exit code -1073740791 (0xC0000409) I was using this post as a reference Rotating a pixmap in pyqt4 gives undesired translation…
Ainadiel
  • 13
  • 1
  • 2
1
vote
1 answer

qt gui to display video using Qfiledialogbox and qlabel .here is my code

FIRST CODE In this code VideoCapture cap is not taking filename (which contains video path) which is obtained after executing QFileDialog i.e. with cap.open("fileName") ,code is not executing while with cap.open("G:/mixer.avi") ,code is executing…
Khushbu
  • 21
  • 6
1
vote
1 answer

It is possible to assign it a keyboard shortcut or mnemonic In QLabel?

When using a QLabel in PyQt5, it is possible to give it a keyboard shortcut or mnemonic ... For example : by setting the text to "E&xit", the mnemonic is x, and the keyboard shortcut is Alt+x.
Kumar
  • 592
  • 6
  • 18
1
vote
0 answers

Interact with a Qlabel an mouseclick

I am currently reproducing the Diaballik game on qwidget with qtcreator. I decided to make a login page as well as a game page. The problem I have is that I need a qgridlayout in which I add buttons or labels with which I have to interact via the…
1
vote
1 answer

set label size as big as QPixmap image

I have an label that displays an image, however the image is cut off since its size is bigger than the label, I have tried self.logo_buttons.SetScaledContents(True)but this only resizes my image to fit in the label. from PyQt5.QtCore import * from…
user11794063
1
vote
1 answer

How draw Polygon from MouseEvents on top of Image in Qlabel

Using Python , PYQT5 I want to draw a Polygon on top a Image, which is in a Qlabel widget. I used a simple Qmainwindow with a label widget generated in QT designer (code is below). I am aware that there are several informations out abaut drawing in…
Erich
  • 41
  • 7
1
vote
1 answer

How to display message in Qlabel from externally called Python function

I actually have 3 questions in this. I have a pushbutton which calls an external function (code example given below). when I press Run button, and function is being executed. I want to display message from that function to my Qlabel in window. so…
Vi_py123
  • 73
  • 1
  • 9
1
vote
1 answer

Rotate a QPixmap inside a QLabel causes the pixmap to move along the x-axis rather than staying inside the QLabel

I am trying to get a ball(QPixmap inside a QLabel) to rotate while bouncing off the edges of the screen. But the ball, even though it does rotate seems to be moving along the axis inside the QLabel so after a few movements of the timer it moves…
1
vote
2 answers

Mouseover Event in PyQt5

I want to get the position of mouse while it's hovering over a label. I read this but my problem is different. I need to grab the mouse position as it hovers over my label without clicking so, mouseMoveEvent doesn't help here's my code: class…
M.H.Muhamadi
  • 139
  • 2
  • 8
1
vote
1 answer

Outputting the results of a DataFrame to a QLabel

I have a Pandas DataFrame that outputs correctly in the Python console, however I'm creating an application using QT designer and would like this DataFrame to be output on a QLabel, the label is called: .…
MB4ig
  • 65
  • 5
1
vote
1 answer

Why does Qt.AlignCenter onQLabel differ for image and text in PyQt5?

I am new to python and currently doing some basic excerises. I'm trying to rewrite some application in which I used tkinter to do the same with PyQt5. Everything works apart from one problem - I have a QLabel containing image and I'm trying to align…
cyanidem
  • 103
  • 2
  • 9