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

Qt : Display a picture during application loading

I want add a splash screen to an application which is slow to load. I have create a simple app to test. main.cpp : int main(int argc, char *argv[]) { QApplication app(argc, argv); QPixmap pixmap("/home/helene/Images/my_image.png"); if…
helene
  • 1,201
  • 2
  • 18
  • 30
4
votes
1 answer

QPixmap only works with absolute Path

I am trying to set icons for my QPushButtons. I was only able to do so by putting the full path into the QPixmap constructor. Something like this works: m_button->setIcon(QPixmap("C:/Users/Desktop/project/img/pic.png")); So I think the problem does…
user2302702
  • 95
  • 1
  • 7
4
votes
1 answer

how to set QPixmap as brush for rectangle properly?

i want to set a QPixmap as brush for a rectangle in paint method .I do this work but it doesn't set accurately .I test many value for width and height but yet it wasn't good .Overall, what sizes should I set for the rectangle surrounding the photo…
maryam
  • 1,437
  • 2
  • 18
  • 40
4
votes
1 answer

How to get the exact location from a click on the qgraphicsscene in Qt

I am writing codes to load in image from a file and did some edits on this image(change some pixels' value), zoomed in or zoomed out and then save the image. Also, I want to know the location in the original image associated to a click on the…
ivory
  • 243
  • 4
  • 16
4
votes
4 answers

Create QR-code in Python (PyQt)

I'm currently using PyQt4 and qrcode4.0.4. from PyQt4 import QtGui, QtCore from PIL.ImageQt import ImageQt import qrcode class QRLabel(QtGui.QLabel): def __init__(self, text=""): super(QRLabel, self).__init__() …
4
votes
0 answers

using QImage to display dpx or exr through QPixmap

How do I display a exr or dpx file format image using QImage through QPixmap ? Somebody told me QImage does the I/O operation for which plugins need to be installed !! this is really confusing me now.
Ciasto piekarz
  • 7,853
  • 18
  • 101
  • 197
4
votes
3 answers

Qt Background Image for a QPushButton

I need to put an image from the internal resources as a background image of a QPushButton. I need also to adapt the size of the image to the size of the button. I have found here some way to do that, but nothing seems to work. In the last reply it…
Rudy Barbieri
  • 389
  • 1
  • 4
  • 16
4
votes
1 answer

Qt QPixmap size

I would to have a QPixmap with the size 50 x 50. I tried : QPixmap watermark(QSize(50,50)); watermark.load(":/icoMenu/preparation"); but the QPixmap take the image size. I tried also : QPixmap…
artoon
  • 729
  • 2
  • 14
  • 41
4
votes
1 answer

Convert 16-bit grayscale to QImage

I am working on a sensor-based Python application built on a PyQt4 GUI. The sensor is generating 16-bit measurements... 256 16-bit "pixels" per "line". A square "image" is acquired by obtaining 256 lines, resulting in a (256,256) Numpy array of…
ph0t0n
  • 735
  • 1
  • 10
  • 24
4
votes
1 answer

How to update a QPixmap in a QGraphicsView with PyQt

I am trying to paint on a QPixmap inside a QGraphicsView. The painting works fine, but the QGraphicsView doesn't update it. Here is some working code: #!/usr/bin/env python from PyQt4 import QtCore from PyQt4 import QtGui class…
pops
  • 43
  • 1
  • 4
4
votes
2 answers

Better way to load QPixmap data

Better way to do it (without QImage)?: QImage image(width, height, QImage::Format_RGB888); memcpy(image.bits(), m_frameRGB->data[0], height * width * 3); QPixmap pixmap = QPixmap::fromImage(image); I don't see any reason to use QImage as…
DEgITx
  • 960
  • 1
  • 13
  • 24
4
votes
1 answer

"Python.exe" crashes when PyQt's setPixmap() is called with a Pixmap

I have a program that sends and receives images to each other using sockets. The server sends the image data using 'image.tostring()' and the client side receives it and turns it back into an image using 'Image.fromstring', then into a QImage using…
CWang
3
votes
2 answers

QPixmap maintain aspect ratio

I'm writing a program that will allow me to upload photos to TUMBLR via their API, I've got the uploading working (thanks to you guys). I've put a 'queueBox' on the side of the GUI, which displays the image names, and they are stored in a…
Anteara
  • 729
  • 3
  • 14
  • 33
3
votes
1 answer

Qt Phonon & QPixmap::GrabWidget

I've been working for a couple of days on grabbing frames from a phonon media object. My aim is to capture frames at some interval specified by the user. I firstly tried to implement a slot for the tick signal associated with Phonon::MediaObject.…
Sixx
  • 57
  • 7
3
votes
1 answer

Qt: update pixmap grid layout with 2d array values

I am undertaking a game using a combination of c++ in visual studios 2010 and Qt 4.7 (both windows). The game is a clone of battleship and is console input based. I have created my gui how I want it to look, and on the Qt side in Qt designer, my…