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
0 answers

How to resize Text of QLabel displayed on other screen resolutions

We have a GUI created with Qt Creator. When we use this GUI on different machines with higher screen-resolution, some of the text sizes of our QLabels do not resize as we want. In the below example we have 3 QLables but only the second ( Number of…)…
user3443063
  • 1,455
  • 4
  • 23
  • 37
2
votes
2 answers

Keep aspect ratio of image in a QLabel whilst resizing window

Say i have a layout like this: I want the ratio of the left object and the right object to always be like this: So that i can add a small image in the top left corner that wont be gigantic or too small, but always in nice relation to the size of…
Ythotha74
  • 83
  • 5
2
votes
0 answers

How can clipping be prevented on a Qt QLabel?

I have a dialog created in Qt Designer with contents that resize when the window is resized. When the window height is made too small, the text in the window clips as follows: How do I prevent the labels from being clipped? Most specifically, the…
Graham Leggett
  • 911
  • 7
  • 20
2
votes
2 answers

HTML fails in Qt QLabel

When using a QLabel element filled with some html text, I have a problem: it does not simply render the HTML, it inserts some space around the html text. The following renders ok: A simple text! The following fails: A HTML
Wanderson Silva
  • 1,179
  • 1
  • 17
  • 35
2
votes
1 answer

find parent of mousepress event of multiple randomly created widgets(like QLabel,QPushButton etc.) in PyQt5

I have created multiple QLabels using for loop with same variables.Now i need to know that from where/which Lable,MousePress event is triggered.Is there any way like event.parent() OR event.widget() I also tried installEventFilter but its not…
Rajkumar
  • 530
  • 4
  • 9
2
votes
1 answer

Individually color characters in QLabel

I am trying to find out if there is a way to split the text contained inside a QLabel into multiple labels, one for each character in the text. What I am trying to accomplish is to be able to color each character in the label individually, so I can…
Adrian Costin
  • 418
  • 3
  • 12
2
votes
1 answer

How to print std::cout messages to QLabel or QTextBrowser

Am trying to print all console output messages to a QLabel or QTextBrowser. Does anyone know how to do this? Thanks for any help, CV
Chenna V
  • 10,185
  • 11
  • 77
  • 104
2
votes
2 answers

QT resize problem after zoom

I'm trying to zoom in a picture using QT and C++. I inherited QLabel objects in my classes to show pictures. And also put this QLabels in mdiarea. zoom function is working fine however the qlabel does not update its size immediately. If I try to…
tkcn
  • 516
  • 3
  • 10
  • 29
2
votes
1 answer

Pyqt5 QGridlayout issue when using QTextEdit

I want to adjust height and width using grid layout. class MatchStepWidget(QWidget): def __init__(self,parent): super(MatchStepWidget,self).__init__(parent) self.initUI() def initUI(self): layout =…
dauren slambekov
  • 378
  • 3
  • 15
2
votes
1 answer

How to zoom a picture implemented with QPixmap on pyqt5

I am trying to zoom in a picture i implemented with QPixmap but nothing works. Here is the way i implemented this. (self.hauteur is a float that represents the height) self.label.setPixmap(QPixmap(self.image).scaledToHeight(self.hauteur)) I've put…
Edouardinho
  • 23
  • 1
  • 4
2
votes
1 answer

How can i change/update label

I am trying to build a simple internet speed test app using pyqt5 I am a beginner and trying to build small apps to learn GUI basics So here is the code whenever i try to change label text from my thread function is says that self has no member…
2
votes
2 answers

printing text in qt mainwindow.ui window in my widget application

I know that Label is what i use to set some text in a single line, however I want to print multiple lines, more specifically is a loop foreach that will print all the data the user entered previously. There is some way?
user29893
  • 31
  • 1
  • 6
2
votes
2 answers

How to Increase /decrease the font size In PyQt5 QLabel (Fixed Size)?

In my code, use one QLabel with fixed dimension/size. At beginning, I assign text "Hello,Python" to that QLablel. Now I want to change the text of the QLablel to "Hai, Welcome to Python". How to decrease the font size of the QLabel, and display…
Kumar
  • 592
  • 6
  • 18
2
votes
1 answer

Do I ever need to manually destroy objects (like pixmaps)?

I am writing a PySide2-based applicatioon, which includes a QScrollArea that holds a lot of QPixmap images (or better: a list of QLabel's that in turn contain the pixmaps). That list of images can grow quite large over time, so when a certain number…
Matthias
  • 9,817
  • 14
  • 66
  • 125
2
votes
1 answer

How to set fixed Icon size that scales with HiDPI in Qt

How can I set Icon size in my application so that it's still scaled when the users uses Screen Scaling? In my application I have a QToolBar in the MainWindow that seems to use an Icon size of 24x24. I have some QToolButton which seem to get an Icon…
Damir Porobic
  • 681
  • 1
  • 8
  • 21