I have a "tooltip.png" file in my local directory. the code below works when i put it in int main() but doesn't work when i put it in my MainWindow class constructor:
QGraphicsScene scene;
QGraphicsView *view = new QGraphicsView(&scene);
QGraphicsPixmapItem item(QPixmap("tooltip.png"));
scene.addItem(&item);
view.show();
in int main() it show the picture but in constructor doesn't