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

Preserve aspect ratio during minimize/maximize when displaying image?

I'm trying to implement a scalable image widget with qt creator that will preserve the aspect ratio of the image. All the examples or posts I've found suggest extending QLabel and reimplementing resizeEvent. This is what I've done and it almost…
2
votes
1 answer

pyqt- how to create clicked signal for QLabel class?

i've created a image button class from QLabel. Now i wanna add a clicked signal to that. now, what to do? class PicButton(QLabel): def __init__(self,pixmap1,pixmap2,parent=None): QLabel.__init__(self, parent) self.pic =…
iraj jelodari
  • 3,118
  • 3
  • 35
  • 45
1
vote
1 answer

PopUp Window. How to show full text content and two other questions

I created a popup window like this: QFileInfo FileA = "AAA"; QFileInfo FileB = "BBB"; if (fileA.exists() == false & (fileB.exists() == false)) { QFrame* PopupWin = new QFrame(this, Qt::Popup | Qt::Window ); …
Streight
  • 811
  • 4
  • 15
  • 28
1
vote
1 answer

Deleting a HBitmap placed into a QLabel

I have a series of QLabel objects on my Qt GUI, and I fill them with HBITMAP objects. These HBITMAP's are buffers in memory, they don't exist on disk. Now I use the QPixmaps fromWinHBITMAPto create aQPixmapwhich I can then pass to…
Tony The Lion
  • 61,704
  • 67
  • 242
  • 415
1
vote
1 answer

QLabel positioning woes

I have made the following basic image viewer in Qt, however it does not behave as expected and for the love of what is holy, I cannot find out what the problem is. Basically, it's a QLabel for which I have set the movie as a jpeg/gif and then…
Nini Michaels
  • 341
  • 7
  • 17
1
vote
1 answer

How can I align some of the text on the left, and some of it on the right without using two labels

I want to use QLabels to display some data in this format username:.....Erich Lancaster (without dots) Location:.......Wherever Is there a way to do this?
W.K.S
  • 9,787
  • 15
  • 75
  • 122
1
vote
3 answers

Theta and Alpha Symbols In QLabel

I'm a student programmer and I'm using Qt to create a Gui that gets input from users for a simulation. I am trying to use the theta and alpha symbol in a QLabel. I have looked over Qt's QLabel Documentation and found that QLabel does support…
Wylie Coyote SG.
  • 1,009
  • 6
  • 22
  • 37
1
vote
1 answer

PyQt5 I can't see background picture when I added layouts

import sys from PyQt5 import QtWidgets,QtGui def Window(): app = QtWidgets.QApplication(sys.argv) window = QtWidgets.QWidget() window.setWindowTitle("GORKIDEV Application") window.setWindowIcon(QtGui.QIcon("telefon.png")) …
1
vote
1 answer

Set a tooltip for a hypertext link in a QLabel

I have a QLabel with an embedded link: QString LinkName ("...") ; QString DestName ("...") ; QLabel* myLabel ; ... myLabel -> setText (QString ("Click here to go to %2") .arg (LinkName).arg (DestName))) ; The label is displayed…
TonyK
  • 16,761
  • 4
  • 37
  • 72
1
vote
1 answer

Displaying an image in QLabel

I have created a Qt interface, add a Qlabel and set pixmap to an image. imagelabel = new QLabel(centralwidget); imagelabel->setObjectName(QString::fromUtf8("imagelabel")); imagelabel->setGeometry(QRect(20, 10, 371,…
user982209
  • 183
  • 2
  • 3
  • 7
1
vote
1 answer

Pyqt5 how can I remove Qlabel after adding them several times

I am trying to make a card game. After 1 game, I need to clear QLabel to start new game. Following is the summery that I am debugging. I want to clear all QLabel with QPushButton operation. But actually I could remove only the last Qlabel. Rest of…
Taniguchi
  • 13
  • 4
1
vote
1 answer

Make Custom QLabel Dragable c++

I have created a custom QLabel class and am trying to make it dragable. I have tried my best but have failed in doing so. I saw many related questions, also tried chatgpt but could not get desired results. All events are called as expected except…
farhan jatt
  • 509
  • 1
  • 8
  • 31
1
vote
1 answer

How to correctly update QScrollArea when dynamically removing a QLabel from it?

I'm developing a timeline editor containing tracks represented by QLabels in a QScrollArea. First there's a track by default, and we can add and remove tracks dynamically. I'm having issue with the fact that when there are a few tracks left (3) and…
1
vote
0 answers

How can I make labels clickable in PyQt5?

I am currently working on a project in Python. To create the GUI, I used PyQt5 Designer. (The pictures I will link NOT be my project, I just try to make this feature work in a separate dummy program, cause I have the same problem in my project). So…
1
vote
0 answers

Creating QPainter object by passing pixmap via ".pixmap()" causes: "QPaintDevice: Cannot destroy paint device that is being painted"

Ive just recently started to use PyQt6. I am trying to make a custom UI-element so i am (trying) to use QPainter. However even the example code on https://www.pythonguis.com/tutorials/pyqt6-bitmap-graphics/ doesn't work and outputs QPaintDevice:…