I'm trying to load an image file from disk and I would like to draw the same image along with a rectangle whose size is updated using spin boxes. However, I couldn't load the image. I'm using this code:

Qt Code:
  1. QImage img("/c/documents and settings/usr/desktop/c++/qt/experiments/boundary/sample.jpg",0)
  2. QPixmap pixmap = QPixmap::fromImage(image);
To copy to clipboard, switch view to plain text mode 

The image file is named as sample.jpg. Thanks for the help.