@EarthHobbit
Hi
This sample works for me
(i can click it )
#include <QApplication>
#include<QGraphicsScene>
#include<QGraphicsDropShadowEffect>
#include<QGraphicsPixmapItem>
#include<QMessageBox>
#include<QGraphicsView>
class myGraphicsPixmapItem: public QGraphicsPixmapItem {
public:
myGraphicsPixmapItem(QPixmap pixmap): QGraphicsPixmapItem(pixmap) {
};
~myGraphicsPixmapItem() {
};
void mouseReleaseEvent(QGraphicsSceneMouseEvent* event) {
QMessageBox::information(NULL, "Information!", "Mouse release Detected!");
};
};
int main(int argc, char* argv[]) {
QApplication app(argc, argv);
QGraphicsScene scene;
QPixmap pix(200, 200);
QPainter* paint = new QPainter(&pix);
paint->setPen(QColor(255, 34, 255, 255));
paint->drawRect(0, 0, 200, 200);
myGraphicsPixmapItem* pixmapItem = new myGraphicsPixmapItem(pix);
pixmapItem->setFlags(QGraphicsItem::ItemIsMovable);
delete paint;
QGraphicsView view(&scene);
scene.addItem(pixmapItem);
view.showFullScreen();
return app.exec();
}