QPixMap not loading, Error : <Information not available, no symbols loaded for Qt5Gui.dll>
-
Trying to load a png file using QImage/QPixmap. It's compiling and linking fine, when I try to execute the code, I am seeing the below error :
QImage object is null. -
Trying to load a png file using QImage/QPixmap. It's compiling and linking fine, when I try to execute the code, I am seeing the below error :
QImage object is null.Hi and welcome to devnet forum
Are you using Qt creator when running into that problem?
-
@koahnig said in QPixMap not loading, Error : <Information not available, no symbols loaded for Qt5Gui.dll>:
e you using Qt creator when running into that problem?
Thanks for the quick reply. I am running it from Visual Studio 2015, which uses Qt libraries.
-
@koahnig said in QPixMap not loading, Error : <Information not available, no symbols loaded for Qt5Gui.dll>:
e you using Qt creator when running into that problem?
Thanks for the quick reply. I am running it from Visual Studio 2015, which uses Qt libraries.
Are you following some guidelines like this here https://doc.qt.io/qtvstools/index.html
AFAIK when using Qt libs directly with Visual Studio you are required to use such tools.
Based on your error message Qt libs are probably not installed as requried. Possibly some path setting is missing. However, I am not familiar with Visual Studio and the setup required of Qt libs.
An alternative would be using Qt creator together with the Visual Studio compiler.
-
I was able to load the png file in Qt Creator. In my project we use the Qt-everywhere source code and build the libraries and then use it in visual Studio. Any leads will be helpful.
Thanks. -
Any leads will be helpful on this. Alternate suggestions for rendering png, jpeg images will also be helpful.
-
Any leads will be helpful on this. Alternate suggestions for rendering png, jpeg images will also be helpful.
@avinash_pai
Hi
Why are you compiling your own version of Qt ?
Also Visual 2015 is rather old now. What Qt do you use with it?If you run the app standalone, will it then show image ?
-
We are using Qt as one of the third party libraries. I am using Q5.12.
If I use QImage and QPainter in Qt creator, I am able to load the image. But when I try in Visual Studio, there is no data in the QImage instance. -
We are using Qt as one of the third party libraries. I am using Q5.12.
If I use QImage and QPainter in Qt creator, I am able to load the image. But when I try in Visual Studio, there is no data in the QImage instance.@avinash_pai Please show your code
-
I implemented the same code in QtCreator , it worked. Not working in Visual Studio.
void BqtOglCanvas::drawImage(int width, int height, BmRect imageRect) { imgFlag = true; resultSize = QSize(width, height); paintRect = QRect(QPoint(imageRect.pnt1.x, imageRect.pnt1.y), QPoint(imageRect.pnt2.x, imageRect.pnt2.y)); } QImage* BqtOglCanvas::loadImage(const QString &fileName, QImage *image) { image->load(fileName); *image = image->scaled(resultSize, Qt::KeepAspectRatio); return image; } QImage BqtOglCanvas::getSourceImage() { return sourceImage; } void BqtOglCanvas::paintEvent(QPaintEvent *e) { if (imgFlag) { imgFlag = false; QImage sourceImage = getSourceImage(); QImage* img = loadImage("C:/Users/qu826e/Downloads/ply.png", &sourceImage); const QRect imageRect = paintRect; const QImage resImage = *img; QPainter painter(this); painter.drawImage(imageRect, resImage); } }
-
I implemented the same code in QtCreator , it worked. Not working in Visual Studio.
void BqtOglCanvas::drawImage(int width, int height, BmRect imageRect) { imgFlag = true; resultSize = QSize(width, height); paintRect = QRect(QPoint(imageRect.pnt1.x, imageRect.pnt1.y), QPoint(imageRect.pnt2.x, imageRect.pnt2.y)); } QImage* BqtOglCanvas::loadImage(const QString &fileName, QImage *image) { image->load(fileName); *image = image->scaled(resultSize, Qt::KeepAspectRatio); return image; } QImage BqtOglCanvas::getSourceImage() { return sourceImage; } void BqtOglCanvas::paintEvent(QPaintEvent *e) { if (imgFlag) { imgFlag = false; QImage sourceImage = getSourceImage(); QImage* img = loadImage("C:/Users/qu826e/Downloads/ply.png", &sourceImage); const QRect imageRect = paintRect; const QImage resImage = *img; QPainter painter(this); painter.drawImage(imageRect, resImage); } }
@avinash_pai said in QPixMap not loading, Error : <Information not available, no symbols loaded for Qt5Gui.dll>:
QImage* img = loadImage("C:/Users/qu826e/Downloads/ply.png", &sourceImage);
Is it this QImage which is null? Does the file exist? Is the PNG file valid?
-
yes this one is null. The file exists and is valid