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

QListWidgetItem items overlap each other

I have defined a widget, which contains a QLabel (and other elements) that should show wrapped text. This QLabel has: Horizontal Policy: Minimum Vertical Policy: MinimumExpanding WordWrap: true The widget has: LayoutSizeConstraint:…
Peter
  • 31
  • 3
3
votes
3 answers

Make a QLabel blink

I'm using Qt to make a gui application for my beagleboard. I'm trying to make a QLabel blink with a custom image. QTimer::connect(timer, SIGNAL(timeout()), this, SLOT(blink())); timer->start(1000); I'm thinking to use QTimer to call the blink()…
Loc Dai Le
  • 1,661
  • 4
  • 35
  • 70
3
votes
1 answer

Adding a QLabel to a QWidget

I am new to Qt and C++ and working on an application and I am trying to add QLabel in a QWidget, using QHBoxLayout. I am setting the text of label to something but it is not visible in the Label. Here is the piece of the code: setStyleSheet(…
Sadaab
  • 83
  • 1
  • 1
  • 7
3
votes
1 answer

Qt QImage to QPixmap Conversion loses Color Information for UI

I am trying to update a QPixmap on a QLabel in my main Qt UI. The following slot is called to do this with the "newImage" variable QImage ( because it's from a different thread ). The QImage is converted to someImage with convertFromImage ( I've…
PhilBot
  • 748
  • 18
  • 85
  • 173
3
votes
2 answers

What is the correct method to get all QLabels form UI in QList?

QList labelList; foreach (QLabel lbl, ui) { labelList.append(lbl); } I wanted to add all QLabels in the QList, above code generates an error, please help
Vinay Kulkarni
  • 81
  • 1
  • 10
3
votes
1 answer

Get real margins of image label in Qt

My application has a custom QSS, and I have a QLabel with an image. The image has big margins, however, which come from the style. This is how the label looks, the QPixmap is solid red to show the actual contents, so the white parts are the…
sashoalm
  • 75,001
  • 122
  • 434
  • 781
3
votes
1 answer

QLabel::setPixmap() and QScrollArea::setWidget()

I've been tracking down a bug that boils down to this - if you show an image label inside a scroll area, the label will not be resized to the image's size if QLabel::setPixmap() is called after QScrollArea::setWidget(). This example illustrates the…
sashoalm
  • 75,001
  • 122
  • 434
  • 781
3
votes
3 answers

Remove space from QLabel in a QTreeWidget

I've added QLabel widgets to my QTreeWidget to work around the word wrapping issue in QTreeWidget. (see how to word wrap a QTreeWidgetItem). The QLabel widgets appear to have spacing around the text which for some reason disappears when the text…
Jason
  • 1,098
  • 12
  • 33
3
votes
1 answer

Spacing between widgets in QHBoxLayout

I'm trying to create a GUI with QtCreator. For this GUI, I need to display several images with different sizes next to each other. These images should be touching each other. I use a QWidget with a QHBoxLayout, where I add the labels (with different…
Tcanarchy
  • 760
  • 1
  • 8
  • 20
3
votes
1 answer

QT QLabel (used as an image container) fullscreen bug

A experienced the following bug in Qt 4.8.5, under Ubuntu 13.04 (and I'm nem to Qt) I have have an application with the following structure: Mainwondow -CentralWidget --VerticalLayout ---TabWidget ---QLabel (created with code, and added to the…
András Kovács
  • 847
  • 1
  • 10
  • 29
3
votes
1 answer

How to translate with Qt Linguist with label arguments (%1)

I got a line for a Qlabel like this: QString(tr("Are you sure you want to delete the scene called %1 ?")).arg(variable); Some people told me you can't translate that. They told me to append different strings with the parameters and the text... But…
Darkgaze
  • 2,280
  • 6
  • 36
  • 59
3
votes
1 answer

QLabel don't refresh with Pixmap convertFromImage

I use a QLabel to display a pseudo-video stream. Since I have extensive calculation to do on the pixels, I use the QImage bits() function and then convert it to a pixmap to show it on the QLabel. So far I was using: for(...) { …
2
votes
2 answers

Animating image replacement in Qt

I'm trying to animate the change of a QPixmap, inside QLabel. I have MainWindow which holds several objects that derive from QScrollArea. Each of these holds a QLabel member. Using mousePressEvent() I am able to replace the picture of each QLabel…
2
votes
1 answer

`QPixmap` and `QLabel` size slightly increases when reloading

When I'm trying to make my app, I stumbled upon this unexpected behavior where when I re-display a new QPixmap in a QLabel. I tried to simplify the code and ended up with the code below. I also attached the video of the behavior. I provided here a…
Eliazar
  • 301
  • 3
  • 13
2
votes
1 answer

QSlider not displaying transparency properly when overlapped with QLabel - PyQt5

Pretty sure I've looked everywhere on the whole internet for why this is happening so I've resorted to asking a question for once. Anyway, I'm trying to make a transparent (apart from the borders) QSlider lay on top of a QLabel with a QPixmap set on…