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

Qt::Pixmap in Qwidget doesn't show up in MainWindow

Here is another newbie to Qt. What I need to do is to have a scrollable Area in the center of MainWindow, which displays images, and allows user to paint on the image. Since I cannot add a QPixmap directly to a scrollable Area, I tried to create a…
user1819047
  • 667
  • 9
  • 18
0
votes
2 answers

Qt c++ QPixmap check if its initialized

i try to check if QPixmap is initialized, when i try to check using : QPixmap pix; if(pix.data_ptr()) or if(pix != null) where pix is member of QPixmap type . all gives me : Access violation reading location 0x0000000c. how can i…
user63898
  • 29,839
  • 85
  • 272
  • 514
0
votes
1 answer

Cannot load pixmap

I'm trying to load image to pixmap. Image itself is added to resources. So here what I'm trying to do: result = pixmap.load("Field/foreground.png"); result is always false. Image exists, I can get it's absolute path like this: QFile…
Roman
  • 1,396
  • 4
  • 15
  • 39
0
votes
1 answer

Why the pixmap(a football field image) disappear when I try to draw something on its QLabel?

guys.I have a QLabel with a pixmap-a PNG image(typically a football playground) and I wanna draw some rectangels(represent some robots) on the playground,which I use the painter class to draw actually on its container-the QLabel. But when I use the…
Derek
  • 41
  • 2
  • 8
0
votes
1 answer

How to save a graphics image from QGraphicsScene in pyQT

How to render a graphics image from QGraphicsScene in pyQT I have an image in QGraphicsScene, which is created from multiple QGraphicsPixMapItem items. I need to render it out as a single image on disk. Thanks
Program Questions
  • 440
  • 2
  • 6
  • 20
0
votes
1 answer

strange behaviour while adding QIcon

I am adding a items to listwidget but strangely the first block of if adds icon while the second one doesnt i also checked that the icon is in place in the specified location def addToRenderQueue(self): …
user1176501
0
votes
1 answer

Changing QLabel setPixmap() through a QPushButton signal

I am writing a simple program that displays an image when a button is pressed. I'm very new to Qt, and I am not having any luck identifying where my problem is occurring. class ImageSwitcher : public QWidget { Q_OBJECT …
mr0il
  • 61
  • 1
  • 7
0
votes
1 answer

QT4: which QPainter::CompositionMode is suitable to merge two pixmaps with white background to mix the two foreground contents

I am using QPainter to put a pixmap onto another. The pixmaps have white BG. I want that the result is a pixmap with white BG but with mixed content, even if it is ugly and confused. I want to create a "fusion" image.
P5music
  • 3,197
  • 2
  • 32
  • 81
0
votes
1 answer

Qt - How to Draw an Icon Image to a QListWidgetItem

I have QListWidget, in that I had added the items. i had made the QListWidgetItems to scroll from right to left in a QWidget. Now i want to add a Icon image before every item that is Scrolling in the QWidget. How to draw an Icon image in a QWidget…
New Moon
  • 787
  • 6
  • 21
  • 35
0
votes
1 answer

How to stop the background from repeating in a QpaintEvent

I have a paintEvent and I'm adding the background everytime I paint something, the problem is that I need the image to stop repeating. For example if my background image is 20pixels x 20 pixels, and my paint area is 40pixels x 40pixels, the…
acerqueiro
  • 29
  • 5
0
votes
1 answer

QString with text and an image

Is there a way of inserting an image in a QString? I need to have a QString this way " 'image' some text" It needs to be a QString since i'm inserting it in a QPaint event and i cant use a QLabel for that (because i can't insert a qlabel into the…
acerqueiro
  • 29
  • 5
0
votes
1 answer

QPixmap image file not appear on QGraphicsScene

By modifying Qt's Diagram Scene sample, I want my window to display an overlay object when a user clicks on a region that's described by GraphicalScene (original sample shows instead QPolygon). In the following code I'm using QPixmap. However…
IsaacS
  • 3,551
  • 6
  • 39
  • 61
0
votes
2 answers

how to binary to qpixmap

I find it difficult to translate binary into picture, I use a pixmap. transfer into the binary is correct but when I show using this program actually does not work. this is my code: if…
Majapahit
  • 31
  • 5
0
votes
1 answer

QGraphicsPixmapItem

QGraphicsPixmapItem, like QGraphicsItem, has a method update(x0, y0, width, height), in order to redraw a pixmap only partly on a QGraphicsScene. Calling this will schedule a paint() (in Qt's event loop) on the QGraphicsItem, and after this paint()…
Herbert
  • 5,279
  • 5
  • 44
  • 69
0
votes
1 answer

Connecting QPixmaps with the data being drawn on them

I am looking for a way to connect the QPixmap and the data being written on it, so that in the end I can have an accurate record of what is currently on the screen. void QPainter::drawRects(const QRectF *rects, int rectCount) This is an example…
Raghd Hamzeh
  • 314
  • 10
  • 17