Basically I am trying to load the image as a texture using QPixmap:
texture[T_WALL] = bindTexture(QPixmap(":/images/wall.png"), GL_TEXTURE_2D);
The code works on my development machine, but not in the vm / other pcs without QT. Initially I was using jpegs and just assumed that I messed up the plugins, but as I understand, no plugins are needed for png files so I have no idea where the problem is.
Results are the same when loading local files and using Qt resources.
I am deploying libgcc_s_dw2-1.ddl, mingwm10.dll, QtCore4.dll, QtGui4.dll, QtOpenGL4.dll. Do I need anything else?
Try adding an imageformats directory to your application directory and put qmng4.dll there. See my answer to the question Qt dll deployment on windows
If it still does not work, get the Sysinternals suite which contains dgbview.exe that allows you to watch qDebug messages (even for release builds).
Related
I set a background image(JPEG) on a Qt widget using setStyleSheet(). This is perfectly shown on my computer, but not on another computer.
I am not getting a link error on the other computer -- the feature just doesn't work. Is there something I am missing in the distribution or build of my app, something that the Qt dev tools installs or is otherwise available, that isn't present on other machines? How can I distribute a Qt app that uses JPEG functionality?
JPEG support in Qt comes as a plugin. Make sure you have also deployed the plugin to your non-development machine. If you haven't, it will simply silently fail and you'll end up not seeing any of the JPEG images. Have a look at the official documentation for more detailed information: http://qt-project.org/doc/qt-4.8/deployment-windows.html
In short (and as a quick solution, but have a look at the documentation as well) you could create a directory named "imageformats" as a subdirectory of the folder containing your exe, into which you copy QJPEG4.dll.
I have been working on a Qt OpenGL project for a bit now for some school work. I had to re-build Qt 5.0.1 for my windows machine so I could use OpenGL proper. At the end of this project I need to turn over the files and any executables, so I figured I could take the release .exe and stick it in a .zip for use.
I followed instructions online of making sure I place any needed .dll's into the .exe's dir. For my project there are 10:
icudt49, icuin49, icuuc49, libEGL, libGLESv2, Qt5Core, Qt5Gui, Qt5OpenGL and Qt5Widgets
I took these files all from:
C:\Qt\Qt5.0.1\5.0.1\msvc2010\bin
on my system.
Issue is the .exe will run and I get the UI and all. But the OpenGL scene is just black. I can still click objects in the scene, evidently zoom in and out and all that. I assume thats just the Qt translating the commands still. But nothing is visible. I'm unsure what the problem can be because it all works fine when launched from the creator.
EDIT: So, with all the dlls in the release folder, running the project from within creator will also have a black screen, when I remove them, it runs well. So perhaps one of the dll's is just wrong?
Also:
I looked online about publishing with Qt Creator and found not too much aid, said I should start from completely rebuilding Qt Creator staticly, but I'm sure the guide I had followed did this, however I still can't publish from the build menu, so I stuck with the above method.
I suggest, that you open every of the DDLs in your Zip file with Dependency Walker (http://www.dependencywalker.com/). It should display information about dependencies from one of your QtXXX.dll files to other files. If one of the dependencies is missing, you know where to look next. You can also try to open your executable with Dependency Walker. I haven't used the program for a long time so I don't remember if opening an executable is the only way it works. Anyway, here are the reasons why you might want to use the tool: http://www.dependencywalker.com/help/html/overview_1.htm
This question might also be helpful:
At least one module has an unresolved import due to a missing export function in an implicitly dependent module
Good luck!
So the ultimate issue was the use of the correct DLLs. Using something like DependenyWalker can help you to note which DLLs may be missing, however it did nothing in my case.
I had installed Qt once, and also rebuilt, uninstalled and re-installed it. However all the libraries it was calling from as no longer in C:\Qt\Qt5.0.1\5.0.1\msvc2010\bin as expected, it was calling from the github repository where I built it C:\Users\User\Documents\GitHub\qt5. Once this is sorted out, it still required a framework folder and then it works as expected.
1) Copy the correct DLL files to the release folder of the build.
2) Create a folder in the same dir as the .exe named "platforms". (Note: elsewhere has said create plugins>platforms, but this will not work with newer Qt versions)
3) From the same source you got the other DLLs, copy qwindows.dll to the platforms folder you created.
4) Run the executable and enjoy.
As long as the system you're running on is capable of your OpenGL structure, it should be fine.
I am coding a GUI using Qt. When I run the application using QtCreator, my images do not load, and I receive the following error:
QPixmap::scaled: Pixmap is a null pixmap
Yet, when I run the application via command line, everything displays perfectly.
Why so? And how can I get QtCreator to load my images properly?
NB: Those images are barely 20ko each, so what I read about images being too big can't apply.
EDIT: A typical filename is 'Images/Cards/Base/card01.jpg', where Images is a subdirectory of my project directory (the code being at the root)
If you are working with images that should be bundled with the application, such as icons, then you should try and make use of the Qt Resource system.
This allows you to build the resources into the actual project and reference them in a filesystem independent syntax. i.e.: :/icons/myIcon.png
Most likely you have a difference between the relative location of the file in Qt Creator vs the command line.
I wrote a Qt/QML application and every thing is OK during compile time and running on my own system. But when I move this software to an another computer none of pictures loads.
for example here is my background picture:
Image{
id:background;
source:"qrc:/qml/MobnaPC/images/back.jpg"
}
this image loads when I run the executable file ( which is created in release mode ) in my system ( development environment system ) but when I move this file and its associated dlls to another system( without Qt installed) the background image doesn't load.
I also tried relative addressing instead of resource system. but the problem remained. How can I solve this strange behavior?
You are missing the Qt plugins that handle JPEG image formats. The simplest way to solve this is to copy the qjpeg4.dll into the same working directory as your executable.
I'm having problems with deploying an application on Windows that displays an animated gif. For this purpose I use a QMovie and it works fine if I launch it from QtCreator. I gathered the files that are needed to run the application, and I can launch it just fine, but the gif won't show up.
I read this page and came to the conclusion that I need to add the qgif4.dll plugin which is located in qt/bin/plugins/imageformats. I tried copying it into a plugins folder next to the application, also plugins/imageformats, but it still doesn't work. I also tried to
QApplication::addLibraryPath(QDir::currentPath());
and copy the qgif4.dll file next to my executable - without any success. How do I fix this?
Put it in ./imageformats, relative to the executable.