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

How to hide QLabel by default in QtDesigner

I've been working on project in Visual Studio and QtDesigner. I want to set QLabel(pixel, mm) be invisible by default. Someone have any idea ?
manuntn08
  • 61
  • 1
  • 7
3
votes
1 answer

Qlabels getting clipped off at the end

I am trying to make a GUI for a piece of python code using PyQt. However, the GUI seems to cut off the ends of two Qlabels for reasons I don't know. I have gone through other Questions on Stack Overflow for similar issues, but i did not find a fix…
Animikh Aich
  • 598
  • 1
  • 6
  • 15
3
votes
2 answers

QLabel does not display in QWidget

I have the following hierarchy in my Qt Application: QMainWindow > QWidget (centralWidget) > QWidget (subclassed) > QLabel Initialization code in my QMainWindow code: centralWidget = new…
Laurent Crivello
  • 3,809
  • 6
  • 45
  • 89
3
votes
1 answer

How to add both an image and text to a QLabel

I have a QHBoxLayout with a QLabel in it, and I'm trying to get both an icon and window title text in the QLabel. Is that possible? Or even to add the icon directly to the QHBoxLayout, so that is is laying just before the window title text? Here is…
Maxwe11
  • 97
  • 1
  • 1
  • 9
3
votes
1 answer

QLabel higlight searched word

I'm developing a Qt application and I'm trying to implement this feature where if you type a word all it's occurences in a QLabel get highlighted. I'm not sure how to do it. Is there a way for iterate through text in QLabel and change the…
madasionka
  • 812
  • 2
  • 10
  • 29
3
votes
1 answer

paint over QLabel with PyQt

For a Python project, I have to draw an image with a painter over a Qlabel widget already filled by a picture. My problem is that my image is systematically drawn behind my Label. I simplified the problem by this code, my goal is to paint…
T.C
  • 31
  • 1
  • 2
3
votes
1 answer

displaying image using a label

I have converted a numpy array into a pixmap to display it on a label within my GUI. When I run the program, the GUI closes for some reason (no error messages). height, width = input_image.shape bytesPerLine = 3 * width qImg =…
Senyokbalgul
  • 1,058
  • 4
  • 13
  • 37
3
votes
1 answer

QT add Label to certain position

I'm new to QT and I want to know how to add a label on a certain position by code. I create a new application and I have these code automatically: #include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : …
Hongxu Jin
  • 817
  • 2
  • 9
  • 16
3
votes
2 answers

Underline QLabel's text "on hover"

I want to turn the text green and underline it when the mouse cursor goes over a QLabel, however, it just turns green, it does not get underlined. QLabel:hover { color: green; text-decoration: underline;} What am I doing wrong? EDIT: Fixed, I…
Mattia F.
  • 1,720
  • 11
  • 21
3
votes
1 answer

QFrame's stylesheet affecting QLabel

I am using QFrame just to have colored border, since I couldn't find the a way to change color of the QDialog. So because of tampering with QFrame's border, it is also affecting the QLabel's look, is there any way to avoid this? Edit: Here is the…
jxgn
  • 741
  • 2
  • 15
  • 36
3
votes
0 answers

How to set the QLabel's style sheet just with the qss?

In my code I customized the QLabel and defined the signal of clicked. I want to set the QLabel's style by qss file. It seems that the hover status works but the press status doesn't work. Anybody knows what is wrong? dlabel.h #ifndef…
seme
  • 43
  • 7
3
votes
5 answers

How to add a button with image and transparent background to QVideoWidget?

I created a pushbutton in front of a video (use QVideoWidget and QMediaPlayer). I am using an image with a transparent background to set image button. How can I set a QPushbutton to be transparent, but the image inside to be visible? I have tried…
vee sivee
  • 53
  • 1
  • 1
  • 10
3
votes
1 answer

How to make reduce/expand QLabel according to text

Suppose I have a QLabel and want to change its text. If text is too long to be show entirely, I loose a part of it. Can I re-dimension the QLabel according to the text I write in it?
LittleSaints
  • 391
  • 1
  • 6
  • 19
3
votes
2 answers

How to display Arabic notations in left-to-right direction in QLineEdit/QLabel etc.?

In Qt's implementation arabic notation is shown in right-to-left direction, thus any strings that contain arabic notations will be right-aligned. But what my application wants to do is showing all texts in left-to-right direction, whether it…
waterd
  • 603
  • 1
  • 7
  • 23
3
votes
3 answers

How to display text in main window?

I'm new to Qt and I'm having a hard time finding a simple example illustrating how to display some text on the main window. For example, I just want to save some text in a string and display the contents on the main window. I thought to do something…
the_prole
  • 8,275
  • 16
  • 78
  • 163