Mobility
15th June 2013, 08:55
Hi guys,
Simple case, just cannot figure out what I'm doing wrong. I'm using Qt Creator to create simple application. At the first phase, I only want it to show a image in QLabel.
This is what I have done:
1. Added the image to resource file.
2. Added a QLabel to the window.
3. From the property menu of the QLabel, I have added the image using QLabel->Pixmap option. As a result the image is shown in the Qt Creator just fine and it also shows fine when using the preview tool (ctrl+alt+r).
4. Everything seem to be fine, but when running the app the image is not shown.
I also tried setting the image to the QLabel in the cpp, but it didn't help either:
QPixmap pixmap( ":/pics/test.jpg" );
ui->label_2->setPixmap(pixmap);
Then also checked the app with Dependency Walker and nothing seems to be missing.
Any idea what's wrong?
Cheers!
Simple case, just cannot figure out what I'm doing wrong. I'm using Qt Creator to create simple application. At the first phase, I only want it to show a image in QLabel.
This is what I have done:
1. Added the image to resource file.
2. Added a QLabel to the window.
3. From the property menu of the QLabel, I have added the image using QLabel->Pixmap option. As a result the image is shown in the Qt Creator just fine and it also shows fine when using the preview tool (ctrl+alt+r).
4. Everything seem to be fine, but when running the app the image is not shown.
I also tried setting the image to the QLabel in the cpp, but it didn't help either:
QPixmap pixmap( ":/pics/test.jpg" );
ui->label_2->setPixmap(pixmap);
Then also checked the app with Dependency Walker and nothing seems to be missing.
Any idea what's wrong?
Cheers!