Questions tagged [qpixmap]

The QPixmap class, part of the Qt framework, is an off-screen image representation that can be used as a paint device.

QPixmap class is one of Qt classes for handling image data. It is designed and optimized for showing images on screen.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

499 questions
5
votes
1 answer

Why doesn't setting the pixmap of a QLabel work?

I've created a subclass of QLabel that I intend to use in a QGraphicsView. It serves as a movable "point" that one can click on and drag around the graphics view. Creating the custom class and having it displayed in the graphics view hasn't been an…
Dany Joumaa
  • 2,030
  • 6
  • 30
  • 45
5
votes
2 answers

Zoom in scaled down QPixmap: can't restore original size

I am making an application where I need to draw figures (i.e. rectangles) above a picture and resize the whole scene. I'm using QGraphicsView and QGraphicsScene. I can't figure out why but when I was using fitIntoView() I was unable to draw figures…
lena
  • 1,181
  • 12
  • 36
5
votes
3 answers

Make a pixmap transparent for a QLabel

I have a MainWindow with a QLabel and a pixmap. I want to make it transparent (or less opaque) I am using the following code below. ui->label->setAttribute(Qt::WA_TranslucentBackground); ui->label->repaint(); However it does not seem to work. The…
Elseine
  • 741
  • 2
  • 11
  • 23
5
votes
3 answers

Problems with large QImage

I'm pretty new to C++/Qt and I'm trying to create an application with Visual Studio C++ and Qt (4.8.3). The application displays images using a QGraphicsView, I need to change the images at pixel level. The basic code is (simplified): QImage* img =…
David Günzel
  • 73
  • 1
  • 4
5
votes
1 answer

Displaying a video stream in QLabel with PySide

Can anybody point me in the right direction on how to create a new QMovie "provider" in PySide? I have a video stream that I want to display as simply as possible (no audio, just a sequence of frames with an unknown and variable framerate). This…
StFS
  • 1,639
  • 2
  • 15
  • 31
5
votes
1 answer

High performance QImage output to display

I'm trying to make video output (sequence of frames) to any qt visible widget. At beginning i thought that QLabel will be enough for this point... but i was wrong. Converting to pixmap is too overloading for processor at large images: 1080p for…
DEgITx
  • 960
  • 1
  • 13
  • 24
4
votes
2 answers

How to show pixel position and color from a QGraphicsPixmapItem

I'm developing a custom widget with QGraphicsScene/View and I have no prior experience with it. The custom widget is an image viewer that needs to track mouse movement and send signal(s) to it's parent dialog / window. The signal(s) will be the…
Symbiosoft
  • 4,681
  • 6
  • 32
  • 46
4
votes
1 answer

How to convert a QPixmap's image into a bytes

I want to take an image's data from a QLabel and then store it into a PostgreSQL Database, but I cannot store it as QPixmap, first I need to convert it into a bytes. That's what I want to know. I've read part of the pyqt5's doc, specially the…
4
votes
1 answer

QLabel with image in round shape

I want to display image with round shape in PyQt5/PySide2 application. Below is the code i tried. self.statusWidget = QLabel() img = QImage(":/image.jpg").scaled(49, 49, Qt.IgnoreAspectRatio,…
4
votes
1 answer

PyQt: How do I handle QPixmaps from a QThread?

This has to be the biggest nuisance I've encountered with PyQT: I've hacked together a thumbnailing thread for my application (I have to thumbnail tons of big images), and it looks like it would work (and it almost does). My main problem is this…
Blender
  • 289,723
  • 53
  • 439
  • 496
4
votes
1 answer

Qt: Get a standard cursor pixmap

The QCursor class provides methods get and set a QPixmap or a QBitmap on the cursor. I can create a cursor from one of the standard shapes, e.g. Qt::ArrowCursor. However, if I do so, I cannot get the pixmap/bitmap of the cursor! QCursor…
Felix
  • 6,885
  • 1
  • 29
  • 54
4
votes
1 answer

How to set an application icon in Qt

I have some trouble trying to set an icon for my QT application. The icon is named "room.ico" and is on the same directory as the source file. Here is the code : #include #include int main( int argc, char *argv[ ] ) { …
The Beast
  • 1,629
  • 2
  • 29
  • 42
4
votes
1 answer

How do I draw a QFont anti-aliased when the OS has anti-alias turned off?

When I use a QPainter to drawText onto a QPixmap using a QFont, it appears anti-aliased when the OS has anti-alias enabled, but not when it doesn't even though I am explicitly setting render hints of the painter and strategy of the font: QPainter…
jtooker
  • 1,043
  • 1
  • 8
  • 22
4
votes
2 answers

Pixmap shared between threads in Qt

I've got a main GUI class and another Worker class: the first copes with GUI things (drawing a QPixmap into a QGraphicsScene), the second with computations thing (drawing QLines and QPoints onto that QPixmap). The two classes run in two different…
Michael
  • 876
  • 9
  • 29
4
votes
1 answer

Drawing a line with a pixmap brush in Qt?

For some time I'm developing a simple drawing and painting app with Qt/C++. Currently I'm using QPainter::drawLine() to draw, and it works fine. What I want to do is drawing with pixmap brushes, which in a way I can do. I can draw with single color…
user4516901
1 2
3
33 34