Lazaruspl
23rd June 2010, 09:56
Hi,
I have application and there in MainWindow I set some background image:
QPixmap bg("./images/Background.jpg");
QPalette p(palette());
p.setBrush(QPalette::Background, bg);
setAutoFillBackground(true);
setPalette(p);
I can also do that using styles, and I can also do that using resource files. But in all those cases there is a problem. When I start application from Qt creator everything is ok. It is displaying image in background without a problem. But when I add those dlls to application folder:
mingwm10.dll
QtCore4.dll
QtGui4.dll
and I start application, background image is missing. My window icon is also not working while it was ok when I run app from Qt creator without those dlls.
I've tried adding image formats dlls to folder but unfortunately without effect. I've also tried adding them to \imageformats\ folder witch I created in application folder.
Maybe I do something wrong, I don't know. I would appreciate if someone could give me simple app, just MainWindow without anything other, that has got image background, witch is loaded in constructor and is working. Then I would compare code of that application with mine and maybe that could help.
I'm using Qt Creator 1.2.1 Based on Qt 4.5.2 (32 bit). My OS is Windows 7 professional 64bit. But the same problem I had on Vista 32bit.
I have application and there in MainWindow I set some background image:
QPixmap bg("./images/Background.jpg");
QPalette p(palette());
p.setBrush(QPalette::Background, bg);
setAutoFillBackground(true);
setPalette(p);
I can also do that using styles, and I can also do that using resource files. But in all those cases there is a problem. When I start application from Qt creator everything is ok. It is displaying image in background without a problem. But when I add those dlls to application folder:
mingwm10.dll
QtCore4.dll
QtGui4.dll
and I start application, background image is missing. My window icon is also not working while it was ok when I run app from Qt creator without those dlls.
I've tried adding image formats dlls to folder but unfortunately without effect. I've also tried adding them to \imageformats\ folder witch I created in application folder.
Maybe I do something wrong, I don't know. I would appreciate if someone could give me simple app, just MainWindow without anything other, that has got image background, witch is loaded in constructor and is working. Then I would compare code of that application with mine and maybe that could help.
I'm using Qt Creator 1.2.1 Based on Qt 4.5.2 (32 bit). My OS is Windows 7 professional 64bit. But the same problem I had on Vista 32bit.