Questions tagged [qgraphicspixmapitem]

QGraphicsPixmapItem is a class of Qt (a cross-platform application development framework).

QGraphicsPixmapItem is a class of Qt (a cross-platform application development framework). The QGraphicsPixmapItem class provides a pixmap item that you can add to a QGraphicsScene (Qt Documentation)

46 questions
0
votes
1 answer

PyQt5 pixel level collision detection

I'm learning Python and thought to make a simple platform game with PyQ5t. Currently I'm in trouble when I want to make a pixel level collision detection between shapes in my game. I have set the QPixMap to transparent and also tried to use…
0
votes
1 answer

QGraphicsPixmapItem - trigger only event of the top object

I am trying to make a card game. The player has vector of Cards and(hand) which is represtend in GUI. My cards inherits from QGraphicsPixmapItem and QObject. What I want to achieve is to set MouseEvent on Card and trigger this event only for one…
Eddy
  • 593
  • 8
  • 22
0
votes
0 answers

Why the QGraphicsPixmapItem exists offset when use fitInView() function?

I use fitInView() function to view the image pixels, but image pixels exists offset, how to solve this problem? void QtGraphicsView::setViewRect(const QRectF &rect) { if (m_viewRect == rect) return; m_viewRect = rect; …
Yasin
  • 36
  • 4
0
votes
0 answers

Qt:Add a list of QGraphicsPixmapItems to a scene group?

I'm trying to group a list of QGraphicsPixmapItems in a QGraphicsScene. However, I see that I can only add lists of QGraphicsItems to the scene. What would be the best way to typecast a list of QGraphicsPixmapItems to a list of QGraphicsItems? Is…
0
votes
1 answer

Qt: how to make QGraphicsPixmapItem automatically move in a repeating route

I am making a game now, and I want my QGraphicsPixmapItem automatically move from left to right and right to left between my view repeatedly in the same route. To be more specific: my enemy start at (0,0), and it start off by heading right…
史努比
  • 15
  • 5
0
votes
1 answer

QPixmap: How to increase the size of the picture in addPixmap?

class MyGraphicsView(QGraphicsView): def __init__(self): super(MyGraphicsView, self).__init__() scene = QGraphicsScene(self) self.tic_tac_toe = TicTacToe() scene.addItem(self.tic_tac_toe) self.m =…
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
0
votes
1 answer

Draggable pixmaps inside a QGraphicsScene of graphic items

I have a scene with a 12*4 grid with blocks of QGraphicsItems ,when i right click on the blocks I have a contexmenu that can add icons inside the blocks my proplem is that I can't fingure out how can I make those icons draggable to the other…
Sonicpath
  • 231
  • 4
  • 16
0
votes
0 answers

QGraphicsPixmapItem: No such file or directory ^

I have a problem with Qt. I made some code yesterday and yesterday everything worked fine, but today i got this message. I reinstalled Qt two times and still got same message on different projects. Someone know how to deal with this? Here is error…
NoName
  • 31
  • 4
0
votes
1 answer

Resize QGraphicsPixmapItem

I need to place a clickable picture on the QGraphicsScene. This is how I did it: class myGraphicsPixmapItem: public QGraphicsPixmapItem { public: myGraphicsPixmapItem() { } ~myGraphicsPixmapItem() {} void…
0
votes
1 answer

Qt QGraphicsProxyWidget hiding other QGraphicsProxyWidgets

I'm working on a Slotmachine with QGraphicsScene and -View and I'm close to the end of that project. But now I want to add a small rect to the winning-lines that shows the amount of won credits in that line. The rect is a QLabel in a…
prix
  • 99
  • 1
  • 11
0
votes
0 answers

Having trouble drawing an image in Qt using QGraphicsScene

The code below loads an image using QLabel. The code uses: myLabel.setMask(pixmap.mask()); and it works as it should. The problem comes when I try and load an image using QGraphicsScene. #include #include #include…
Aborg
  • 11
  • 2
0
votes
1 answer

Image not shown in PyQt4: Debugging hints

I'm writing an Application with PyQt where a lot of images are displayed. I use basically the same draw Routine for all my images, which works fine except for one image, which resides in a tab widget. Here the drawing routine: def draw(self, array,…
0
votes
1 answer

Move a QGraphicsPixmapItem through keyboard

I have a a character added via QgraphicsPixmapitem and now I want to move it by pressing the arrow keys on the keyboard. But I can't find a way. It gives compilation error. Help me please! moveship.h (header file for my QPixmapItem) #ifndef…
Swapnil Pandey
  • 577
  • 3
  • 8
  • 25
-1
votes
1 answer

QGraphicsPixmapItem is not rotating correctly

I need to rotate a QGraphicsPixmapItem through a circle. That is, the circle always needs to be at the top left corner of the image and when I drag the circle, the image has to rotate. I set the rotation angle using setRotation and the rotation…
-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…