سؤال

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top