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

How to center QPixmap while Painting it inside QItemDelegate of QListWidget

I'm painting a QPixmap inside the QItemDelegate of QListWidget. Each QListWidgetItem is of different dimensions. Inside the void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) function of QItemDelegate, I…
-1
votes
1 answer

videocapture and pyqt

i use this lib http://videocapture.sourceforge.net/ for a capturing web cam. But i don't understand how it video-stream send to qpixmap.
John Smith
  • 11
  • 1
  • 4
-1
votes
0 answers

Can QPixmaps be used in background thread?

I tried drawing in a QPixmap in worker thread . It works as expected . But as per documentation it is not recommended to draw in worker thread . What are the consequences of creating and adding in background thread? How do i measure the rendering…
Akshaya S
  • 1
  • 2
-1
votes
1 answer

How to drag and drop a specific QPixmap into a QGraphicsView?

On a subclassed QListWidget I have several items. Every QListWidget item (e.g. "ROS Init", "Images" etc) that is shown below is associated with a specific icon. The problem I have is that I am trying to drag and drop the specific icon corresponding…
Emanuele
  • 2,194
  • 6
  • 32
  • 71
-1
votes
1 answer

How to rotate an QGraphicsPixmapItem in Qt

I am trying to rotate an image in Qt. If you try this game, you can easily see how the arrow is rotating: https://www.friv.com/z/games/killcovid19/game.html?Desktop-x-x-w-x-x-xx Assuming my image is in a QGraphicsPixmapItem, how should I make it…
-1
votes
2 answers

How to save the QPixmap of a label which consist of one more label above it which has a Qpixmap

I have inherited the QLabel to create my own class of QLabel, The code is below: class myLabel : public QLabel { Q_OBJECT public: explicit myLabel(QWidget *parent=nullptr): QLabel(parent){ setFrameShape(QFrame::Box);} QLabel…
Vinay Kumar
  • 674
  • 2
  • 9
  • 21
-1
votes
1 answer

How to add a pixmap drawn in QGraphicsItem to QGraphicsScene?

How to add a pixmap drawn in QGraphicsItem to QGraphicsScene in the following example? #!/usr/bin/env python from PyQt5.QtCore import QRectF, Qt from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets import QApplication, QGraphicsItem, QGraphicsView,…
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
-1
votes
2 answers

Pyside: Changing QPixmap image with button press

I am making a tool in maya using pyside. I was able to add an image to my UI using QPixmap and adding it to QLabel. I am trying to figure out how to get the image to change with a press of a button (by pointing into to a new image path) but i am…
ghost654
  • 161
  • 2
  • 18
-1
votes
3 answers

How to use qpixmap on another class?

I'm trying to create a QLabel icon with qpixmap. This is my function: void myClass::myFunction() { QPixmap on_icon(":/path"); ui.label_1.setPixmap(on_icon); } My problem is I can use on_icon only in myFunction. How can I use it on…
bladekel
  • 37
  • 7
-1
votes
1 answer

Qt Set image to label reference variable

I have some pictures in the resource file and their file names correspond to their staffIds. this is how I set the picture into my QLabel but nothing is shown. QString staffId; staffId=ui->lineEdit_staffID->text(); QPixmap…
-1
votes
1 answer

QT - Saving Lower Resolution QPixmap

Im Looking to lower the Resolution of Qpixmap cropped that is then saved a png QPixmap original(imgPath); // read in the image that was selected from tree QPixmap cropped = original.copy(cropRectInt); // make copy of image that is cropped…
John
  • 71
  • 1
  • 8
-1
votes
1 answer

How to use resource properly

When i use resorce it crash my program have no idea how to fix it. Name of resource Resource.grc, name of prefix /imag, name of picture srce_sedam_one.jpg. Everything else work fine. QPixmap pixmap1 = QPixmap (":/imag/srce_sedam_one.jpg"); QMap
mario
  • 111
  • 2
  • 3
  • 8
-1
votes
2 answers

how to get image file format from QPixmap?

In my program, user choice and load an image into QPixmap in some class and after some works on loaded QPixmap the QPixmap passed into an other class, in new class I want to save the passed QPixmap as file, but I don't know what's the QPixmap…
aidinMC
  • 1,415
  • 3
  • 18
  • 35
-1
votes
2 answers

QPixmap::save() returns successful, but yields no file

The docs say this should work: bool did=pixmap.save( "hoppy.png" ); qDebug("did is: %d",did); My logging returns 1 suggesting, as per docs, that the save was successful. However, no file appears on my drive. According to the docs, this save()…
johnbakers
  • 24,158
  • 24
  • 130
  • 258
-1
votes
1 answer

Why can't I load this specific PNG into my QPixmap?

Why can't I load this png into my QPixmap? Open street map png Q_ASSERT(fakeMap.load("C:/map71.png")); This renders an ASSERT. Does not render an ASSERT if I open it in MS paint and re saves it either as a jpeg or png (but larger in size). Same…
Civing
  • 353
  • 3
  • 12
1 2 3
33
34