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

QScrollArea does not attach to label

I am trying to display an image label with scrollbars within a Box layout. However, the scroll area appears at the wrong place with the wrong size. Could you please tell me what I am doing wrong? import sys from PyQt5 import QtCore from…
cbueltem
  • 395
  • 4
  • 10
2
votes
0 answers

Change QLabel Text in PyQT

im new at Python and QT. Here is my Code Snipped. form_class = uic.loadUiType("mainWindow.ui")[0] # Load the UI class MyWindowClass(QtGui.QMainWindow, form_class): def __init__(self, parent=None): QtGui.QMainWindow.__init__(self,…
2
votes
3 answers

Python PyQt Qlabel Resize

I'm having trouble here trying to set my Qlabel size to be bigger. Here is my code. I'm not sure what to do. I have tried lots... def __init__(self, parent=None): super(UICreator, self).__init__(parent) self.Creator = QPushButton("YouTube",…
Tyrell
  • 896
  • 7
  • 15
  • 26
2
votes
1 answer

Prevent QLabel from resizing parent Widget

I have a QLabel inside a QFrame. Sometimes I have too much text in the QLabel and it resizes the QFrame where it is in. Now, I want to prevent the QLabel from resizing the QFrame where it resides in. I don't want to limit the amount of lines or…
tal
  • 860
  • 7
  • 19
2
votes
2 answers

How to make the text fill all the QLabel's space?

I am working on a PyQt5 project, but would be happy to read C++/Qt answer as well, because C++ solutions may work on Python too. I have a MainWindow with a horizontal layout, and a QLabel in it. My QLabel's size Policy is "Expanding", therefore all…
clouvis
  • 567
  • 1
  • 6
  • 18
2
votes
2 answers

QLabel with pixmap image getting blurred

I have an image which I need to display as the background of a QLabel. This is my code (culled from Qt documentation here): #include #include "imageviewer.h" ImageViewer::ImageViewer() { imageLabel = new QLabel; …
SexyBeast
  • 7,913
  • 28
  • 108
  • 196
2
votes
0 answers

How can I achieve a "Karaoke Lyric" like effect with qt (QLabel)

So this is the effect what I want to get. Left and right parts of a label should have different filling/stroke colors (actually stroke size is also changed). And the proportion may change dynamically, and can be some position inside a letter. I…
user3819226
  • 461
  • 1
  • 5
  • 17
2
votes
1 answer

Qt - mouse events on a QLabel

I've got this test piece of code in mainwindow.cpp: bool MainWindow::eventFilter(QObject *obj, QEvent *event) { if (event->type() == QEvent::MouseMove) { QMouseEvent *mouseEvent = static_cast(event); qDebug() <<…
Petersaber
  • 851
  • 1
  • 12
  • 29
2
votes
1 answer

QLabel border won't display with pixmap

I can get a border to display on my QLabels just fine: But when I try to display a pixmap in them, the border goes away: I set the frame properties in the constructor of my QLabel subclass: ObjectSlot::ObjectSlot(int index) { …
TylerKehne
  • 361
  • 2
  • 12
2
votes
0 answers

QLabel bad antialiasing

My problem is, that the antialiasing of the text in the QLabel isn't really good when using fonts with bigger sizes than the default one. Platform is Windows 8.1. Antialiasing enabled: How it should look: Is there any solution with the native Qt?…
acrome
  • 21
  • 3
2
votes
2 answers

QPainter or QLabel is less costly to draw QPixmap

I have to create an Icon pixmap, two methods I am familiarized to do that, One is setting the pixmap as o QLabel and display it, and other is drawing pixmap using QPainter, ie Method one Icon::Icon { QLabel iconLab = new QLabel; QLabel…
Akhil V Suku
  • 870
  • 2
  • 13
  • 34
2
votes
1 answer

Set text direction for QLabel?

Is there a way to set the text direction for a QLabel? I've got a situation in which I have QLabel objects whose text is only punctuation, and I want that to be displayed either in RTL or LTR format. (For instance, parentheses or quotation marks…
adam.baker
  • 1,447
  • 1
  • 14
  • 30
2
votes
2 answers

QLabel & QComboBox setFont does NOT work

I'm using Qt Framework to build an App supporting multiple languages. The default font is loaded from StyleSheet. I override paintEvent() method, and setFont() method works OK for all widgets except for QLabel and QComboBox. For QComboBox, the…
Gabriel
  • 237
  • 3
  • 9
2
votes
1 answer

Hyperlink to web page in QLabel using PySide

I am having troubles displaying a functional hyperlink to a web page in a QLabel using PySide (Python version 3.2.5). Reading the most upvoted answer from this post c++ - Making QLabel behave like a hyperlink - Stack Overflow, I was under the…
user1919235
  • 470
  • 7
  • 17
2
votes
2 answers

Qt - Declaring a QLabel array and adding it to a QTabWidget's tab

I have declared a QLabel array (which i will be using as picture boxes) and the function call which is going to fill the array in the header file of the project as: void fillArray(); QLabel *label_array[7]; Then i called the declared function in…
Devenis
  • 23
  • 5