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

Issue Subclassing a Qlabel C++

I am attempting to subclass a QLabel using a header file and I get the error on constructor IntelliSense: indirect nonvirtual base class is not allowed class foo : public QLabel { Q_OBJECT foo(QWidget* parent = 0) : QWidget(parent) …
Rajeshwar
  • 11,179
  • 26
  • 86
  • 158
2
votes
1 answer

Displaying live camera image in Qt GUI

Im trying to make an application that takes live image recorded by camera and shows it on screen using Qt GUI. The camera driver and api provides me with functionality that refreshes the memory block showed by pointer. The problem is my image won't…
Marcin K.
  • 683
  • 1
  • 9
  • 20
2
votes
1 answer

How to get the size (height) of a label after the word wrap

First of all, I'm sorry because I don't have any code examples to provide (it's quite complex to narrow it down). Essentially, I have QLabel and I'd like to access the height of the label after the word wrap has been applied. It seems that it…
user3034039
  • 43
  • 1
  • 5
2
votes
0 answers

qt label with monospace font acting strange

i have a window made of a bunch of horizontal and vertical layouts, each one containig a grid layout tabling out labels. the whole thing shows the values of a cpu's registers and when the program is executing the lables change values according to…
mellotanica
  • 174
  • 5
  • 12
2
votes
1 answer

QLabel doesn't redraw correctly when in a QHBoxLayout with a stretch

I'm having an odd problem with a label not being redrawn correctly when the text is changed, when it's inside a QHBoxLayout with an added stretch. Consider the following (PyQt) example code: from PyQt5.QtWidgets import QApplication, QHBoxLayout,…
The Compiler
  • 11,126
  • 4
  • 40
  • 54
2
votes
2 answers

How to load an image in a QPixmap to display it in a QLabel

I've read multiple article on it and it still does'nt work!! I know I'm doing it right, but for some reason it does'nt work. Here's my code : myIcon = new QLabel(); QPixmap myPixmapForNow; …
Chax
  • 1,041
  • 2
  • 14
  • 36
2
votes
3 answers

Displaying Integers on QLabels?

Basically i'm making a simple calculator program to understand the basics of C++ GUI however I get an error message leading to the line of code I have in the void MainWindow::addx() to label -> setText(c); with an error message of: invalid…
user3183586
  • 167
  • 1
  • 5
  • 15
2
votes
1 answer

Passing QLabel as a parameter in Qt Creator gives error

I am trying to pass a QLabel as a parameter to another function that is supposed to change the style of the label: main { ... setSeatColor(ui->lblPan2Seat5B, 2); } void setSeatColor(QLabel& lbl, int i) { if(i == 1) { …
Igor Tupitsyn
  • 1,193
  • 3
  • 18
  • 45
2
votes
1 answer

QLabel rotation

I am having a label set from a pixmap as follow: QLabel* label_image; label_image= new QLabel (this); label_image->setGeometry(0, 0, 500, 30); QPixmap pm; pm ... label_image->setPixmap(pm); I would like now to rotate it by 90 degrees. How to do…
MelMed
  • 1,702
  • 5
  • 17
  • 25
2
votes
1 answer

Qt GUI: Select multiple QLabels with mouse

I would like to enable mouse-selection of the text of several QLabels arranged in a grid layout in a Qt GUI. A QLabel has textInteractionFlags like TextSelectableByMouse which enables this behaviour for one object, but a selection across several…
handle
  • 5,859
  • 3
  • 54
  • 82
2
votes
2 answers

Remove extra space around QLabel

I tried stylesheets with padding:0px, text-ident:0px; margin:0px; border: none; And through code, changing the Size Policy to Expanding. The layout inside the widget which has the label has QHBoxLayout* lyt = new…
Darkgaze
  • 2,280
  • 6
  • 36
  • 59
2
votes
2 answers

How to Apply Glow Effect to QLabel Text in Qt?

I need to apply Glow effect to QLabel. Text in Black color and glow effect in white(Stroke Effect). I tried in Google but no luck. If any one knows how apply Glow effect to QLabel then please tell me How to do that.
Saravanan
  • 131
  • 2
  • 13
2
votes
2 answers

Displaying an image and automatically re-size it

I can't quite figure out what the best way of displaying an image is in my particular case, so hopefully someone on here has a few tips. I want to display an image that gets re-sized automatically to fit inside the space that is available. I…
Lieuwe
  • 1,734
  • 2
  • 27
  • 41
2
votes
1 answer

How to move QLabel?

My class uses QWidget and I've got some QPushButtons there and I'd like to set a QLabel on top of each button, which are set on the window by move() but QLabel doesn't want to move... I use setMargin but it moves it from left to right, but not up or…
Kamil
  • 1,456
  • 4
  • 32
  • 50
2
votes
3 answers

Display QImage within main window

I'm trying to display an image with Qt, I can get it to appear in a separate window, but I can't make it appear within the main window Qt_first w; w.show(); This shows the window I designed in Qt designer, how do I access the Qlabel(Image_Lbel) I…
StanOverflow
  • 557
  • 1
  • 5
  • 21