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
10
votes
2 answers

Get Plain text from a QLabel with Rich text

I have a QLabel that contains rich text. I want to extract just the actual (visible) 'text' from the QLabel, and none of the code for formatting. I essentially need a function similiar to the '.toPlainText' method of other Qt Widgets. I can not…
Anti Earth
  • 4,671
  • 13
  • 52
  • 83
10
votes
2 answers

How to enable anti-aliasing on Qlabel?

My QLabels look quite ugly, it seems that there's no anti-aliasing. How can I enable this feature (assuming it's available)?
laurent
  • 88,262
  • 77
  • 290
  • 428
10
votes
3 answers

Mouseover event for a PyQT5 Label

I want that if I move my mouse over the label with text stop on it then it should change the value of a variable Stop to True so that I may pause/stop my program. I have looked the code at Mouseover event filter for a PyQT Label and tried to run it,…
Arun Kumar
  • 101
  • 1
  • 1
  • 3
9
votes
2 answers

Add widgets into a QTabWidget

Can I add some widgets like QLabel and QPushButton into a QTabWidget? Actually, I want to do something like this: I'm using C++ and Qt. Thanks
KelvinS
  • 2,870
  • 8
  • 34
  • 67
9
votes
3 answers

How to change font size of child QLabel widget from the groupBox

How can use different font & size for the child Widgets in the GroupBox and the tittle for the GroupBox in python def panel(self): groupBox = QtGui.QGroupBox("voltage Monitor") groupBox.setFont(QtGui.QFont('SansSerif', 13)) # the…
user2345
  • 537
  • 1
  • 5
  • 22
9
votes
2 answers

How do I make a circle QLabel?

I have a QLabel that i fill in red with the stylesheet, but the QLabel is rectangular, and I want a circle. I try to add border-radius, but it doesn't work, maybe because i put my QLabel in a formLayout. Is there a simple method to have a round…
Evans Belloeil
  • 2,413
  • 7
  • 43
  • 76
7
votes
2 answers

Make Qlabel clickable or double clickable in Qt

I am beginner in Qt, now I want to make my label clickable, I have searched so much online, but no one gives my a real example of how they made it. So can someone teach me step by step? Now my basic thinking is creating a new .c file and new .h file…
innocent boy
  • 315
  • 4
  • 13
7
votes
1 answer

gif image in QLabel

I want to add a gif animated image in QLabel that add into the QGraphicsScene. My code is here: QLabel *lbl = new QLabel; QMovie *mv = new QMovie(":/Images/sun.gif"); mv->start(); lbl->setWindowFlags(Qt::FramelessWindowHint); lbl->setMask((new…
Rmin
  • 73
  • 1
  • 4
7
votes
2 answers

Change QLabel text dynamically in PyQt4

My question is: how can I change the text in a label? The label is inside a layout, but setText() does not seem to work - maybe I am not doing it right. Here is my code: this is the Main windows GUI, the one Qt-Designer gives: class…
n3rio
  • 87
  • 1
  • 1
  • 6
7
votes
3 answers

open webcamera with OpenCV and show it with QLabel - white window

I work on Win7 x64 with OpenCV and Qt Libraries and VS 2010. I would like to open my camera with OpenCV and then to show captured frames with Qt, for example using QLabel, after converting from Mat to QImage. I want to do this because to use the…
Cristina1986
  • 505
  • 1
  • 8
  • 21
7
votes
2 answers

QLabel showing an image inside a QScrollArea

I've successfully implemented a Image Viewer (for DICOM) in Qt. I can see the image and I can zoom in and out correctly. Now, I want to see scroll bars if the image is too big to show when I zoom in. I've used the UI. I placed a QScrollArea. Inside,…
Mark A.
  • 193
  • 1
  • 3
  • 14
6
votes
4 answers

Make QLabel width independent of text

I need a QLabel whose width should not adapt to the contained text but which is resizeable by the user (or the layout to be exact). If the text is too long for the width of the QLabel it should simply be clipped. This question is somehow the reverse…
bjhend
  • 1,538
  • 11
  • 25
6
votes
1 answer

Draw on top of image

I'm new to PyQt5 and I couldn't find any answers that worked for me about how to draw with QPainter on top of a loaded image (QPixmap("myPic.png")). I tried doing it within a paintEvent method but it didn't work. If I want to draw a line on top of…
Johan
  • 863
  • 3
  • 13
  • 28
6
votes
1 answer

Remove an Image in QLabel After Button Clicked

I have qlabels that displaying images . I want to delete image if user clicks remove button . I can learn which image clicked labels[i].mousePressEvent = functools.partial(self.remove_image, source_label = labels[i] ,source_image = pixmap) but i…
Cahit Yıldırım
  • 499
  • 1
  • 10
  • 26
6
votes
1 answer

How to select a region with QRubberBand on a QLabel like in KSnapshot?

I am writing a screenshot utility with PyQt, and the idea is take a screenshot of the whole desktop, then display it in a QLabel, make the window full screen and user selects a region by mouse. Is it possible to do this efficiently with a QLabel? I…
Shuman
  • 3,914
  • 8
  • 42
  • 65
1
2
3
43 44