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

Subclassing QLabel to show native 'Mouse Hover Button indicator'

I have a QLabel with a 'StyledPanel, raised' frame. It is clickable, by subclassing QLabel; class InteractiveLabel(QtGui.QLabel): def __init__(self, parent): QtGui.QLabel.__init__(self, parent) def mouseReleaseEvent(self, event): …
Anti Earth
  • 4,671
  • 13
  • 52
  • 83
4
votes
1 answer

Layering UI elements in Qt Designer

I have a QLabel that I'm constantly setting it's pixmap (video playback). In my application the user needs to be able to draw (boxes) above the video. How can I layer one of the QPaintDevice classes (QWidget, QPixmap, QImage, etc.) directly above…
deRonbrown
  • 635
  • 7
  • 14
4
votes
2 answers

How to receive hover events for child widgets?

I have a QWidget containing another (child) widget for which I'd like to process hoverEnterEvent and hoverLeaveEvent. The documentation mentions that Mouse events occur when a mouse cursor is moved into, out of, or within a widget, and if the…
a_guest
  • 34,165
  • 12
  • 64
  • 118
4
votes
1 answer

How do I align centre image on QLabel in PyQt5?

I am 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 the image in the…
cyanidem
  • 103
  • 2
  • 9
4
votes
1 answer

Scrollable QLabel image in PyQt5

I have developed a form in PyQt5. Among other things it has one button, a ScrollArea which contains QLabel to hold pixMap. On click of the button .jpg image would be displayed in the label. Height, width of the image is much bigger than that of…
4
votes
2 answers

PyQt5 Image and QGridlayout

I've a Widget, which wants to display Images with QLabel and QCheckBox. 4 classes are created each contains some information to be put on the final screen. Class Grid align and grid images, text and checkboxes. After script running get current…
Pavel.D
  • 561
  • 1
  • 15
  • 41
4
votes
1 answer

QLabel with image in round shape

I want to display image with round shape in PyQt5/PySide2 application. Below is the code i tried. self.statusWidget = QLabel() img = QImage(":/image.jpg").scaled(49, 49, Qt.IgnoreAspectRatio,…
4
votes
2 answers

how to set a text as a label when button is clicked?

I want to set text as label when button is clicked. self.labl.setText does work normally, but it doesn't work when it is in button function. I have read all the similar questions here, but still didn't solve the problem :( import sys from…
anna
  • 65
  • 1
  • 1
  • 4
4
votes
3 answers

How change font color for QMessageBox Label's?

What I mean QMessageBox::question, QMessageBox::warning, QMessageBox::critical, QMessageBox::Information { /* Base Text Size & Color */ font-size:12px; color:#ffffff; } If I try QmessageBox .QLabel it's change font for all form/windows end how add…
tseries
  • 723
  • 1
  • 6
  • 14
4
votes
2 answers

PyQt5: Updating Label?

I'm currently having trouble updating labels continuously, I have tried my different ways but either nothing happens or the program stops working. I have attached below part of my code. Also I was hoping someone could explain exactly the purpose of…
ThomasH
  • 67
  • 2
  • 8
4
votes
1 answer

Qt Multiple Types of Styles for an item (QLabel, QPushbutton, ...)

I am designing a UI with Qt Creator 3.6.1 I am using Qt designer form. I have a QWidget which contains 20 QLabels. I want 10 of these QLabels to have a red background color and the other 10 to have a blue background color. I…
AlirezaK
  • 115
  • 6
4
votes
1 answer

PyQt: Adding widgets to scrollarea during the runtime

I'm trying to add new widgets (in the example below I use labels) during the runtime by pressing on a button. Here the example: import sys from PyQt4.QtCore import * from PyQt4.QtGui import * class Widget(QWidget): def __init__(self, parent=…
lucaboni
  • 2,334
  • 2
  • 29
  • 41
4
votes
1 answer

Memory management - Does addwidget assign a parent

Say I have something like this void someClass::start() { QLabel* sb = new QLabel(); sb->setText("Hello World"); ui.verticalLayout->addWidget(sb); } Does addWidget make sb a child of someClass so that when I delete someClass sb is also…
MistyD
  • 16,373
  • 40
  • 138
  • 240
4
votes
0 answers

using QImage to display dpx or exr through QPixmap

How do I display a exr or dpx file format image using QImage through QPixmap ? Somebody told me QImage does the I/O operation for which plugins need to be installed !! this is really confusing me now.
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
4
votes
1 answer

Qt QFont selection of a monospace font doesn't work

i'm trying to make a qt widget that shows a table of qlabels displaying hex numbers. i pass the numbers to the labels as qstrings ready to be printed and the labels work properly but the font type is the system default (a sans serif) that has…
mellotanica
  • 174
  • 5
  • 12